Submission #16226

#TimeUsernameProblemLanguageResultExecution timeMemory
16226eaststar입력숫자 (KOI13_mystery)C++14
100 / 100
0 ms1084 KiB
#include <stdio.h> int a[31],p; int main(){ int i,n; scanf("%d",&n); for(i=0;i<n;++i){ while(a[p])p=(p+1)%n; scanf("%d",a+p); p=(p+a[p])%n; } if(i<n)puts("-1"); else{ printf("%d\n",n); for(i=0;i<n;++i)printf("%d ",a[i]); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...