Submission #5813

#TimeUsernameProblemLanguageResultExecution timeMemory
5813jspark19990205줄 세우기 (KOI13_jul)C++98
0 / 22
144 ms8900 KiB
#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",cnt); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...