8412022-01-20 12:42:21Halasz EszterRendezéscpp11Wrong answer 11/40111ms25440 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;
        sort(x.begin()+a,x.begin()+b+1);
        m--;
    }
    for(i=1;i<=n;++i)
        if(x[i]==i) db++;
    cout<<db;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base11/40
1Accepted0/02ms1808 KiB
2Wrong answer0/013ms2140 KiB
3Accepted2/21ms2104 KiB
4Accepted2/21ms2108 KiB
5Wrong answer0/21ms2104 KiB
6Wrong answer0/21ms2116 KiB
7Wrong answer0/22ms2132 KiB
8Wrong answer0/22ms2156 KiB
9Wrong answer0/22ms2156 KiB
10Wrong answer0/22ms2168 KiB
11Wrong answer0/290ms4644 KiB
12Accepted2/286ms6384 KiB
13Accepted2/286ms8112 KiB
14Accepted1/186ms9848 KiB
15Accepted2/290ms11584 KiB
16Wrong answer0/294ms13304 KiB
17Wrong answer0/2104ms15040 KiB
18Wrong answer0/2111ms16776 KiB
19Wrong answer0/2103ms18508 KiB
20Wrong answer0/197ms20236 KiB
21Wrong answer0/2107ms21968 KiB
22Wrong answer0/293ms23716 KiB
23Wrong answer0/2101ms25440 KiB