Submission #9593

#TimeUsernameProblemLanguageResultExecution timeMemory
9593shinhj88Wiring (kriii2_W)C++98
1 / 4
12 ms1944 KiB
#include <cstdio> #include <memory.h> using namespace std; int main() { int past; bool aa[1000][1000]; memset(aa,false,sizeof(aa)); int n; scanf("%d",&n); int now,cnt = 0;; past = 0; for(int i = 1; i <= n*n; i++) { now = (past + i) % n; if(!aa[past][now] && past != now) { aa[past][now] = aa[now][past] = true; cnt++; } past = now; } printf("%d\n",cnt); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...