Submission #16853

# Submission time Handle Problem Language Result Execution time Memory
16853 2015-10-22T07:36:32 Z hjk0553 입력숫자 (KOI13_mystery) C
100 / 100
0 ms 1084 KB
#include <stdio.h>
int arr[30];
int ans[30];
int main()
{
    int n;
    int i;
    int cnt=0;
    int from=0;
    //freopen("input.txt","r",stdin);
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",&arr[i]);
    while(cnt<n)
    {
        while(ans[from]!=0)
        {
            from=(from+1)%n;
        }
        ans[from]=arr[cnt];
        cnt++;
        from=(ans[from]+from)%n;
    }
    printf("%d\n",n);
    for(i=0;i<n;i++) printf("%d ",ans[i]);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Correct 0 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Correct 0 ms 1084 KB Output is correct
8 Correct 0 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Correct 0 ms 1084 KB Output is correct
8 Correct 0 ms 1084 KB Output is correct
9 Correct 0 ms 1084 KB Output is correct
10 Correct 0 ms 1084 KB Output is correct