This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
int NUM[101];
int ar[101];
int ans[101];
int main(){
int i, token, N;
int count = 0, from = 0, value;
scanf("%d", &N);
for (i = 0; i < N; i++){
scanf("%d", &token);
NUM[i] = token;
ar[i] = token;
}
printf("%d\n", N);
for (i = 0; i < N; i++){
ans[from] = ar[i];
if (i == N - 1) break;
from = (from + ar[i]) % N;
while (ans[from]!=0) from = (from + 1) % N;
}
for (i = 0; i < N; i++) printf("%d ", ans[i]);
return(0);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |