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