Submission #1167548

#TimeUsernameProblemLanguageResultExecution timeMemory
1167548sleepntsheep카멜레온의 사랑 (JOI20_chameleon)C++20
0 / 100
1 ms400 KiB
#include "chameleon.h" #include <vector> namespace { int variable_example = 1; } // namespace void Solve(int N) { int *dead = new int[33333](); int x[55][55]; for (int i = 1; i <= N; ++i) for (int j = i + 1; j <= 2 * N; ++j) x[i][j] = x[j][i] = Query(std::vector<int>{i, j}); int found = 0; for (int i = 1; found < N && i <= 2 * N; ++i) { if (dead[i]) continue; for (int c = 1; c <= 2 * N; ++c) { if (c == i || Query(std::vector<int>{c, i}) > 1) continue; int ok = 1; for (int k = 1; k <= 2 * N; ++k) if (k != i && c != k && x[i][k] > 1 && Query(std::vector<int>{i, c, k}) != x[i][k]) ok=0; if(ok) { ++found; dead[i] = dead[c] = 1; Answer(i, c); goto X; } } X:; } delete[] dead; }
#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...