# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
937331 | 2024-03-03T21:46:37 Z | freedommo33 | Chameleon's Love (JOI20_chameleon) | C++17 | 1 ms | 344 KB |
#include "chameleon.h" #include <vector> #include <iostream> using namespace std; // Function to find a pair given one of the chameleons void findPair(int n, int x, vector<bool>& found) { int low = 1, high = 2 * n, mid; while (low < high) { mid = (low + high) / 2; vector<int> query = {x}; for (int i = 1; i <= mid; ++i) { if (!found[i]) query.push_back(i); } int result = Query(query); if (result < query.size()) { high = mid; } else { low = mid + 1; } } Answer(x, low); found[x] = found[low] = true; } void Solve(int N) { vector<bool> found(2 * N + 1, false); for (int i = 1; i <= 2 * N; ++i) { if (!found[i]) { findPair(N, i, found); } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |