Submission #4989

# Submission time Handle Problem Language Result Execution time Memory
4989 2014-01-23T17:46:09 Z tkxkd7223 줄 세우기 (KOI13_jul) C++
22 / 22
152 ms 8900 KB
#include <stdio.h>
int a[1000010];
int b[1000010];
int main()
{
    int i, n, ma;
    scanf("%d", &n);
    for(i=1 ; i<=n ; i++){
        scanf("%d", &a[i]);
    }
    ma=0;
    for(i=1 ; i <=n ; i++){
        b[a[i]]=b[a[i]-1]+1;
        if(b[a[i]]>=ma)ma=b[a[i]];
    }
    printf("%d", n-ma);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 8900 KB Output is correct
2 Correct 0 ms 8900 KB Output is correct
3 Correct 0 ms 8900 KB Output is correct
4 Correct 0 ms 8900 KB Output is correct
5 Correct 0 ms 8900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 8900 KB Output is correct
2 Correct 0 ms 8900 KB Output is correct
3 Correct 0 ms 8900 KB Output is correct
4 Correct 0 ms 8900 KB Output is correct
5 Correct 0 ms 8900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 8900 KB Output is correct
2 Correct 0 ms 8900 KB Output is correct
3 Correct 0 ms 8900 KB Output is correct
4 Correct 0 ms 8900 KB Output is correct
5 Correct 0 ms 8900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 8900 KB Output is correct
2 Correct 4 ms 8900 KB Output is correct
3 Correct 12 ms 8900 KB Output is correct
4 Correct 20 ms 8900 KB Output is correct
5 Correct 48 ms 8900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 60 ms 8900 KB Output is correct
2 Correct 96 ms 8900 KB Output is correct
3 Correct 120 ms 8900 KB Output is correct
4 Correct 132 ms 8900 KB Output is correct
5 Correct 144 ms 8900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 136 ms 8900 KB Output is correct
2 Correct 152 ms 8900 KB Output is correct
3 Correct 140 ms 8900 KB Output is correct
4 Correct 148 ms 8900 KB Output is correct
5 Correct 148 ms 8900 KB Output is correct