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 <cstdio>
#include <cstring>
int n,a[35],r[105];
int main(){
scanf("%d",&n);
for (int i=0; i<n; i++) {
scanf("%d",&a[i]);
}
int p = 0;
for (int i=0; i<n; i++) {
while(r[p]) p = (p+1)%n;
r[p] = a[i];
p += a[i];
p %= n;
}
printf("%d\n",n);
for (int i=0; i<n; i++) {
printf("%d ",r[i]);
}
}
# | 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... |