9012022-01-26 12:45:03kicsiboglarRendezéscpp11Wrong answer 11/4050ms25996 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long 

using namespace std;

ll n, m, i, j,a,b;

int main()
{
    ios::sync_with_stdio(false);
    cin >> n >> m;
    vector <ll> x(n + 1);
    for (i = 1; i <=n; ++i) cin >> x[i];

    for (i = 1; i <= m; ++i)
    {
        cin >> a >> b;
        sort(x.begin() + a, x.begin() + b+1);

    }
    ll db = 0;
    for (i = 1; i <= n; ++i) if (x[i] == i) db++;
    cout << db;
}

SubtaskSumTestVerdictTimeMemory
base11/40
1Accepted0/02ms1772 KiB
2Wrong answer0/06ms2056 KiB
3Accepted2/21ms2072 KiB
4Accepted2/21ms2080 KiB
5Wrong answer0/21ms2088 KiB
6Wrong answer0/22ms2108 KiB
7Wrong answer0/21ms2136 KiB
8Wrong answer0/21ms2136 KiB
9Wrong answer0/21ms2148 KiB
10Wrong answer0/21ms2136 KiB
11Wrong answer0/232ms5196 KiB
12Accepted2/229ms6928 KiB
13Accepted2/232ms8656 KiB
14Accepted1/130ms10396 KiB
15Accepted2/235ms12132 KiB
16Wrong answer0/241ms13864 KiB
17Wrong answer0/248ms15596 KiB
18Wrong answer0/246ms17320 KiB
19Wrong answer0/245ms19064 KiB
20Wrong answer0/141ms20796 KiB
21Wrong answer0/250ms22532 KiB
22Wrong answer0/241ms24264 KiB
23Wrong answer0/250ms25996 KiB