Submission #9654

#TimeUsernameProblemLanguageResultExecution timeMemory
9654moonrabbit2Wiring (kriii2_W)C++98
1 / 4
20 ms2072 KiB
#include <cstdio> int n; bool link[1005][1005]; int ans; int main() { scanf("%d",&n); int k=0,p,p2; for(p=1;p<=n*n;p++){ int a=(k+p)%n; if(k!=a&&link[a][k]==false&&link[k][a]==false){ ans++; link[a][k]=true; link[k][a]=true; } k=(k+p)%n; } printf("%d",ans); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...