812021-01-10 13:53:52Csizmadia MiklósRobotokcpp11Runtime error 0/50108ms49624 KiB
#include <iostream>
#include <bits/stdc++.h>

using namespace std;

//bool volte [100000];

int main()
{
    cout<<"ITT"<<endl;
    int N;
    int M;
    int K;

    cin>>N>>M>>K;

    vector< pair<int,int> > sor;

    for (int i = 0; i < K;i++)
    {
        int a;
        int b;
        cin>>a>>b;
        sor.push_back({b,a});
    }

    sort(sor.begin(),sor.end());

    int megoldas = 0;

    //vector< pair<int,int> > sorok [86340];
    vector< pair<int,int> > sorok [80000];

    sorok[0]=sor;

    pair<int,int> elozo;
    elozo={0,0};

    for (int i = 0;sorok[i].size()>0;i++)
    {
        megoldas++;
        elozo = {0,0};
        for (int j = 0;j<sorok[i].size();j++)
        {
            if (sorok[i][j].first>=elozo.first && sorok[i][j].second>=elozo.second)
            {
                elozo = sorok[i][j];
            }
            else
            {
                sorok[i+1].push_back(sorok[i][j]);
            }
        }
        sorok[i].clear();
    }
    cout<<megoldas;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/04ms5532 KiB
2Runtime error0/093ms40308 KiB
3Wrong answer0/23ms5732 KiB
4Wrong answer0/23ms5680 KiB
5Wrong answer0/23ms5684 KiB
6Wrong answer0/26ms7204 KiB
7Wrong answer0/26ms7740 KiB
8Wrong answer0/24ms5668 KiB
9Wrong answer0/24ms5672 KiB
10Wrong answer0/24ms5668 KiB
11Wrong answer0/220ms16952 KiB
12Runtime error0/264ms44904 KiB
13Wrong answer0/23ms6004 KiB
14Runtime error0/2104ms48688 KiB
15Runtime error0/293ms49608 KiB
16Runtime error0/2105ms48680 KiB
17Runtime error0/492ms49620 KiB
18Runtime error0/6107ms49624 KiB
19Runtime error0/6108ms48768 KiB
20Runtime error0/6105ms48760 KiB