# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
444746 | 2021-07-15T03:47:50 Z | ics0503 | Chameleon's Love (JOI20_chameleon) | C++17 | 42 ms | 452 KB |
#include "chameleon.h" #include <vector> using namespace std; int cck[1212]; void validation(int n, int i, int j) { vector<int>qr; for (int p = 1; p <= 2 * n; p++) { if (i == p || j == p)continue; qr.push_back(p); } int Q = Query(qr); if (Q != n) { cck[i] = cck[j] = 1; Answer(i, j); } } void S4(int who, vector<int>Y,int n) { int sz = Y.size(), i, j; if (sz == 1) { validation(n, who, Y[0]); return; } vector<int>L, R; for (i = 0; i < sz / 2; i++)L.push_back(Y[i]); for (i = sz/2; i < sz; i++)R.push_back(Y[i]); L.push_back(who); R.push_back(who); int a = Query(L); int b = Query(R); L.pop_back(); R.pop_back(); if (a != L.size() + 1)S4(who, L, n); if (b != R.size() + 1)S4(who, R, n); } void Solve(int n) { if (n <= 50) { int i, j; for (i = 1; i <= 2 * n; i++) { for (j = i + 1; j <= 2 * n; j++) { vector<int>qr; for (int p = 1; p <= 2 * n; p++) { if (i == p || j == p)continue; qr.push_back(p); } int Q = Query(qr); qr.clear(); qr.push_back(i); qr.push_back(j); int P = Query(qr); if (Q != n && P == 1) { Answer(i, j); break; } } } return; } int i, j; for (i = 1; i <= n; i++) { vector<int>Y; for (j = n + 1; j <= n + n; j++) { if (cck[j])continue; Y.push_back(j); } S4(i, Y, n); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Correct | 0 ms | 200 KB | Output is correct |
3 | Incorrect | 40 ms | 328 KB | Wrong Answer [3] |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Correct | 0 ms | 200 KB | Output is correct |
3 | Correct | 0 ms | 200 KB | Output is correct |
4 | Correct | 0 ms | 200 KB | Output is correct |
5 | Correct | 0 ms | 200 KB | Output is correct |
6 | Correct | 0 ms | 200 KB | Output is correct |
7 | Correct | 0 ms | 200 KB | Output is correct |
8 | Correct | 0 ms | 200 KB | Output is correct |
9 | Correct | 0 ms | 200 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Correct | 0 ms | 200 KB | Output is correct |
3 | Correct | 0 ms | 200 KB | Output is correct |
4 | Correct | 0 ms | 200 KB | Output is correct |
5 | Correct | 0 ms | 200 KB | Output is correct |
6 | Correct | 0 ms | 200 KB | Output is correct |
7 | Correct | 0 ms | 200 KB | Output is correct |
8 | Correct | 0 ms | 200 KB | Output is correct |
9 | Correct | 0 ms | 200 KB | Output is correct |
10 | Correct | 6 ms | 200 KB | Output is correct |
11 | Correct | 7 ms | 200 KB | Output is correct |
12 | Correct | 6 ms | 200 KB | Output is correct |
13 | Correct | 6 ms | 296 KB | Output is correct |
14 | Correct | 6 ms | 200 KB | Output is correct |
15 | Correct | 7 ms | 300 KB | Output is correct |
16 | Correct | 8 ms | 296 KB | Output is correct |
17 | Correct | 7 ms | 200 KB | Output is correct |
18 | Correct | 7 ms | 292 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Correct | 0 ms | 200 KB | Output is correct |
3 | Correct | 40 ms | 324 KB | Output is correct |
4 | Correct | 40 ms | 328 KB | Output is correct |
5 | Correct | 42 ms | 328 KB | Output is correct |
6 | Correct | 38 ms | 328 KB | Output is correct |
7 | Correct | 39 ms | 452 KB | Output is correct |
8 | Correct | 41 ms | 328 KB | Output is correct |
9 | Correct | 39 ms | 388 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Correct | 0 ms | 200 KB | Output is correct |
3 | Incorrect | 40 ms | 328 KB | Wrong Answer [3] |
4 | Halted | 0 ms | 0 KB | - |