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