23562023-01-11 08:18:05rennRobotokcpp11Accepted 50/5035ms6624 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, pont;
    cin >> sor >> pont >> 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/03ms1896 KiB
2Accepted0/032ms4052 KiB
3Accepted2/22ms2188 KiB
4Accepted2/22ms2384 KiB
5Accepted2/22ms2592 KiB
6Accepted2/23ms2980 KiB
7Accepted2/23ms3172 KiB
8Accepted2/23ms3356 KiB
9Accepted2/23ms3432 KiB
10Accepted2/22ms3508 KiB
11Accepted2/26ms4172 KiB
12Accepted2/218ms4776 KiB
13Accepted2/23ms3828 KiB
14Accepted2/230ms6212 KiB
15Accepted2/228ms6344 KiB
16Accepted2/235ms6416 KiB
17Accepted4/428ms6420 KiB
18Accepted6/628ms6424 KiB
19Accepted6/632ms6552 KiB
20Accepted6/627ms6624 KiB