8402022-01-20 12:38:28Halasz EszterRendezéscpp11Wrong answer 0/40398ms13028 KiB
#include <iostream>
//#include <fstream>
#include <vector>
#include <algorithm>

using namespace std;

//ifstream cin("rendezes.in");
//ofstream cout("rendezes.out");

vector<int>x;

int n,m,i,a,b,db;


int main()
{
    cin>>n>>m;
    x.resize(n+1);
    for(i=1;i<=n;++i)
        cin>>x[i];
    while(m>0)
    {
        cin>>a>>b;
        partial_sort(x.begin()+a,x.begin()+b+1,x.end());
        m--;
    }
    for(i=1;i<=n;++i)
        if(x[i]==i) db++;
    cout<<db;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/40
1Accepted0/02ms1812 KiB
2Wrong answer0/048ms2152 KiB
3Wrong answer0/21ms2128 KiB
4Wrong answer0/21ms2128 KiB
5Wrong answer0/21ms2128 KiB
6Wrong answer0/21ms2136 KiB
7Wrong answer0/22ms2144 KiB
8Wrong answer0/22ms2164 KiB
9Wrong answer0/22ms2176 KiB
10Wrong answer0/23ms2188 KiB
11Time limit exceeded0/2384ms2436 KiB
12Time limit exceeded0/2351ms3308 KiB
13Time limit exceeded0/2398ms4268 KiB
14Time limit exceeded0/1377ms5080 KiB
15Time limit exceeded0/2395ms6028 KiB
16Time limit exceeded0/2398ms6780 KiB
17Time limit exceeded0/2386ms7860 KiB
18Time limit exceeded0/2391ms8548 KiB
19Time limit exceeded0/2372ms9564 KiB
20Time limit exceeded0/1395ms10324 KiB
21Time limit exceeded0/2398ms11200 KiB
22Time limit exceeded0/2397ms12088 KiB
23Time limit exceeded0/2388ms13028 KiB