23192023-01-10 12:45:37rennRobotokcpp11Accepted 50/5039ms6332 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);
    //read all the coordinations at once
    for(auto &it : pontok)
        cin >> it.first >> it.second;
    sort(pontok.begin(), pontok.end());

    vector<int> indulok(pont);
    int lis_len = 0;
    for(auto akt : pontok) {
        int idx = lower_bound(indulok.begin(), indulok.begin() + lis_len, -akt.second) - indulok.begin();
        indulok[idx] = -akt.second;
        if(idx == lis_len)
            lis_len++;
    }
    cout << lis_len;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1828 KiB
2Accepted0/034ms3912 KiB
3Accepted2/22ms2224 KiB
4Accepted2/22ms2428 KiB
5Accepted2/22ms2668 KiB
6Accepted2/23ms3024 KiB
7Accepted2/23ms3216 KiB
8Accepted2/23ms3244 KiB
9Accepted2/23ms3592 KiB
10Accepted2/23ms3344 KiB
11Accepted2/27ms3656 KiB
12Accepted2/219ms4556 KiB
13Accepted2/22ms3844 KiB
14Accepted2/234ms5972 KiB
15Accepted2/230ms6028 KiB
16Accepted2/239ms6100 KiB
17Accepted4/430ms6072 KiB
18Accepted6/630ms6132 KiB
19Accepted6/632ms6076 KiB
20Accepted6/628ms6332 KiB