7862022-01-12 13:36:54Kevinke12Rendezéscpp14Wrong answer 11/40115ms25500 KiB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int t[100005];
int N, M, be1, be2;

int main()
{
    cin >> N >> M;
    for(int i = 0; i < N; i++)
    {
        cin >> be1; t[i]=be1;
    }
    for(int i = 0; i < M; i++)
    {
        cin >> be1 >> be2;
        be1--; be2--;
        sort(t+be1, t+be2+1);
        //for(int i = 0; i < N; i++) cout << t[i] << " "; cout << "\n";
    }

    int ans=0;
    for(int i = 0; i < N; i++)
    {
        if(i+1==t[i])
            ans++;
    }

    cout << ans << "\n";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base11/40
1Accepted0/02ms1820 KiB
2Wrong answer0/013ms2172 KiB
3Accepted2/21ms2128 KiB
4Accepted2/21ms2132 KiB
5Wrong answer0/21ms2132 KiB
6Wrong answer0/21ms2136 KiB
7Wrong answer0/22ms2152 KiB
8Wrong answer0/22ms2164 KiB
9Wrong answer0/22ms2180 KiB
10Wrong answer0/22ms2196 KiB
11Wrong answer0/286ms4636 KiB
12Accepted2/289ms6364 KiB
13Accepted2/286ms8096 KiB
14Accepted1/182ms9824 KiB
15Accepted2/285ms11644 KiB
16Wrong answer0/296ms13292 KiB
17Wrong answer0/2115ms15020 KiB
18Wrong answer0/2103ms16828 KiB
19Wrong answer0/296ms18492 KiB
20Wrong answer0/198ms20228 KiB
21Wrong answer0/2104ms22036 KiB
22Wrong answer0/293ms23692 KiB
23Wrong answer0/297ms25500 KiB