Submission #5256

# Submission time Handle Problem Language Result Execution time Memory
5256 2014-03-01T15:38:15 Z ansol1111 입력숫자 (KOI13_mystery) C++
100 / 100
0 ms 1088 KB
#include<stdio.h>

int n, a[35], b[35], from, check[35];

int main()
{
    int i;

    scanf("%d",&n);
    for(i=0 ; i<n ; i++)
    {
        scanf("%d ",&a[i]);
    }

    from=0;
    b[0]=a[0];
    check[0]=1;
    for(i=1 ; i<n ; i++)
    {
        from=from+b[from];
        from=from%n;
        while(check[from]!=0)
        {
            from+=1;
            from=from%n;
        }
        check[from]=1;
        b[from]=a[i];
    }
    printf("%d\n",n);
    for(i=0 ; i<n ; i++)
    {
        printf("%d ",b[i]);
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Correct 0 ms 1088 KB Output is correct
7 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Correct 0 ms 1088 KB Output is correct
7 Correct 0 ms 1088 KB Output is correct
8 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Correct 0 ms 1088 KB Output is correct
7 Correct 0 ms 1088 KB Output is correct
8 Correct 0 ms 1088 KB Output is correct
9 Correct 0 ms 1088 KB Output is correct
10 Correct 0 ms 1088 KB Output is correct