Submission #623849

#TimeUsernameProblemLanguageResultExecution timeMemory
623849qwerasdfzxclCave (IOI13_cave)C++14
0 / 100
754 ms400 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; typedef long long ll; int a[5050], ans1[5050], ans2[5050], used[5050]; void exploreCave(int n) { for (int i=1;i<=n;i++){ int ret = tryCombination(a+1); if (ret > i || ret==-1) ans1[i] = 0; else ans1[i] = 1; for (int j=0;j<13;j++){ for (int k=1;k<=n;k++) if (!used[k] && k&(1<<j)){ a[k] = 1; } ret = tryCombination(a+1); if (!(ret > i || ret==-1)) ans2[i] |= (1<<j); for (int k=1;k<=n;k++) if (!used[k] && k&(1<<j)){ a[k] = 0; } } if (ans1[i]) ans2[i] ^= (1<<13)-1; a[ans2[i]] = ans1[i]; used[ans2[i]] = 1; } answer(ans1+1, ans2+1); }
#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...