Submission #5814

# Submission time Handle Problem Language Result Execution time Memory
5814 2014-05-18T03:26:04 Z jspark19990205 줄 세우기 (KOI13_jul) C++
0 / 22
152 ms 8900 KB
#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
1 Correct 0 ms 8900 KB Output is correct
2 Incorrect 0 ms 8900 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 8900 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 8900 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 8900 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 76 ms 8900 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 152 ms 8900 KB Output isn't correct
2 Halted 0 ms 0 KB -