802021-01-10 13:53:03Csizmadia MiklósRobotokcpp11Runtime error 0/50131ms49832 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 [100000];

    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/04ms6388 KiB
2Runtime error0/0131ms41300 KiB
3Wrong answer0/23ms6708 KiB
4Wrong answer0/24ms6528 KiB
5Wrong answer0/23ms6528 KiB
6Wrong answer0/27ms8148 KiB
7Wrong answer0/27ms8592 KiB
8Wrong answer0/24ms6516 KiB
9Wrong answer0/24ms6512 KiB
10Wrong answer0/24ms6512 KiB
11Wrong answer0/221ms17928 KiB
12Runtime error0/268ms45140 KiB
13Wrong answer0/24ms6976 KiB
14Runtime error0/2115ms49696 KiB
15Runtime error0/296ms49832 KiB
16Runtime error0/2101ms49688 KiB
17Runtime error0/4101ms49764 KiB
18Runtime error0/698ms49760 KiB
19Runtime error0/6103ms49616 KiB
20Runtime error0/6125ms49608 KiB