23172023-01-10 12:33:03rennRobotokcpp11Accepted 50/5037ms6500 KiB
#include <bits/stdc++.h>
using namespace std;

#define InTheNameOfGod cin.tie(0); ios::sync_with_stdio(0);

typedef pair<int, int> pii;

int main()
{
    InTheNameOfGod

    int sor, oszlop, pont;
    cin >> sor >> oszlop >> pont;

    
    vector<pii> pontok(pont);
    int a, b;
    for(int i = 0; i < pont; ++i){
        cin >> a >> b;
        pontok[i] = {a, b};
    }
    sort(pontok.begin(), pontok.end());

    vector<int> indulok;
    vector<int>::iterator ind;
    for(auto akt : pontok){
        akt.second *= -1;
        ind = lower_bound(indulok.begin(), indulok.end(), akt.second);
        if(ind == indulok.end()){
            indulok.push_back(akt.second);
        }
        else{
            *ind = akt.second;
        }
    }

    cout << indulok.size();
    
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1696 KiB
2Accepted0/032ms3068 KiB
3Accepted2/22ms2072 KiB
4Accepted2/22ms2272 KiB
5Accepted2/22ms2348 KiB
6Accepted2/23ms2396 KiB
7Accepted2/23ms2708 KiB
8Accepted2/23ms2756 KiB
9Accepted2/23ms2944 KiB
10Accepted2/23ms2956 KiB
11Accepted2/26ms3104 KiB
12Accepted2/218ms3756 KiB
13Accepted2/22ms3284 KiB
14Accepted2/232ms5852 KiB
15Accepted2/228ms5804 KiB
16Accepted2/237ms6080 KiB
17Accepted4/428ms6204 KiB
18Accepted6/628ms6352 KiB
19Accepted6/630ms6500 KiB
20Accepted6/627ms6336 KiB