Submission #754202

#TimeUsernameProblemLanguageResultExecution timeMemory
754202nicksmsCave (IOI13_cave)C++17
0 / 100
2 ms596 KiB
#include "cave.h" #include <bits/stdc++.h> int ans[5000], w[5000], q[5000]; void exploreCave(int N) { for (int i = 0; i < N; i++) { memset(q,0,5000*sizeof(int)); for (int j = 0; j < i; j++) q[ans[j]]=w[j]; assert(tryCombination(q)>=i); w[i]=(tryCombination(q)==i); for (int b = 1; b < N; b<<=1) { memset(q,0,5000*sizeof(int)); for (int k = 0; k < N; k++) { q[k]=1 ^ w[i] ^ __builtin_popcount(k & b); } for (int j = 0; j < i; j++) q[ans[j]]=w[j]; assert(tryCombination(q)>=i); if (tryCombination(q)==i) ans[i] |= b; } } answer(ans,w); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...