23552023-01-11 08:16:20rennRobotokcpp11Accepted 50/5037ms6136 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;

    pii pontok[pont];
    int indulok[pont];
    //read all the coordinations at once
    for(auto &it : pontok)
        cin >> it.first >> it.second;
    sort(pontok, pontok+pont);

    int lis_len = 0;
    for(auto akt : pontok) {
        int idx = lower_bound(indulok, indulok + lis_len, -akt.second) - indulok;
        indulok[idx] = -akt.second;
        if(idx == lis_len)
            lis_len++;
    }
    cout << lis_len;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms2044 KiB
2Accepted0/032ms4052 KiB
3Accepted2/22ms2292 KiB
4Accepted2/22ms2504 KiB
5Accepted2/22ms2704 KiB
6Accepted2/23ms2836 KiB
7Accepted2/23ms3124 KiB
8Accepted2/22ms3008 KiB
9Accepted2/23ms3136 KiB
10Accepted2/23ms3212 KiB
11Accepted2/26ms3676 KiB
12Accepted2/219ms4528 KiB
13Accepted2/22ms3528 KiB
14Accepted2/230ms5848 KiB
15Accepted2/228ms5844 KiB
16Accepted2/237ms5844 KiB
17Accepted4/428ms5972 KiB
18Accepted6/628ms6048 KiB
19Accepted6/632ms6136 KiB
20Accepted6/626ms6136 KiB