119422024-11-21 17:16:56matekimado11Kocsirendezőcpp17Wrong answer 0/10032ms700 KiB
#include<iostream>
using namespace std;
int main()
{
    int n,sz=0;
    cin>>n;
    n++;
    int autok[n];
    for(int i=1;i<n;i++)
    {
        cin>>autok[i];
    }
    for(int i=1;i<n;i++)
    {
        if(autok[i]!=i)sz++;
    }
    if(sz<=2)cout<<"-1 \n";
    else cout<<sz-1<<'\n';
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms500 KiB
2Accepted1ms320 KiB
subtask20/30
3Wrong answer1ms380 KiB
4Wrong answer1ms320 KiB
5Wrong answer1ms320 KiB
6Accepted1ms320 KiB
7Wrong answer1ms320 KiB
8Wrong answer1ms320 KiB
9Wrong answer1ms320 KiB
10Wrong answer1ms320 KiB
11Wrong answer1ms508 KiB
12Wrong answer1ms320 KiB
13Wrong answer1ms320 KiB
14Wrong answer1ms508 KiB
15Wrong answer1ms320 KiB
16Wrong answer1ms320 KiB
17Wrong answer1ms508 KiB
18Wrong answer1ms320 KiB
19Wrong answer1ms320 KiB
20Wrong answer1ms320 KiB
21Wrong answer1ms320 KiB
22Wrong answer1ms320 KiB
23Wrong answer1ms320 KiB
24Wrong answer1ms408 KiB
25Wrong answer1ms384 KiB
subtask30/70
26Wrong answer1ms552 KiB
27Wrong answer1ms320 KiB
28Wrong answer1ms320 KiB
29Wrong answer3ms428 KiB
30Wrong answer4ms424 KiB
31Wrong answer8ms416 KiB
32Wrong answer8ms456 KiB
33Wrong answer18ms432 KiB
34Wrong answer30ms604 KiB
35Wrong answer30ms668 KiB
36Wrong answer32ms700 KiB
37Wrong answer32ms560 KiB
38Wrong answer32ms540 KiB
39Wrong answer32ms620 KiB