This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#include<stdlib.h>
int jul[1000001];
int ch[1000001];
int main()
{
int n;
int i;
int cnt = 0;
scanf("%d",&n);
for(i=1;i<n;++i){
scanf("%d",&jul[i]);
}
for(i=1;i<n;++i){
ch[jul[i]]=i;
}
for(i=1;i<n;i++){
if(ch[i+1]<ch[i])
cnt++;
}
printf("%d\n",cnt);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |