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 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 |
---|
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... |