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, m[32];
int check[32];
int in[32];
int main()
{
int i, cnt, from;
scanf("%d",&n);
for(i=0 ; i<n ; i++)
{
scanf("%d",&m[i]);
}
cnt=1;
from=0;
in[from]=m[0];
check[from]=1;
for(i=1 ; i<n ; i++)
{
from+=in[from];
from%=n;
while(check[from]!=0)
{
from++;
from%=n;
}
in[from]=m[i];
check[from]=1;
}
printf("%d\n",n);
for(i=0 ; i<n ; i++)
{
printf("%d ",in[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... |