# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
448722 | 2021-08-01T03:59:35 Z | kimjg1119 | Chameleon's Love (JOI20_chameleon) | C++17 | 31 ms | 312 KB |
#include "chameleon.h" #include <bits/stdc++.h> using namespace std; int N; vector<int> chk(1010); void f(int x){ int left = 0; for(int i=1;i<=N*2;i++) if(!chk[i]) left++; auto mchk = chk; while(left >= 2){ int mid = left / 2; vector<int> v; for(int i=1;i<=N*2;i++){ if(!mchk[i]) v.push_back(i); if(v.size() == mid) break; } int ret1 = Query(v); v.push_back(x); int ret2 = Query(v); if(ret1 == ret2){ int cnt = 0; for(int i=1;i<=N*2;i++){ if(mchk[i]) continue; if(cnt < mid) cnt++; else mchk[i] = 1; } left = mid; } else{ int cnt = 0; for(int i=1;i<=N*2;i++){ if(mchk[i]) continue; cnt++; mchk[i] = 1; if(cnt == mid) break; } left = left - mid; } } for(int i=1;i<=N*2;i++){ if(!mchk[i]){ Answer(x, i); chk[i] = 1; break; } } } void Solve(int n){ N = n; for(int i = 1; i <= N * 2; i++){ if(chk[i]) continue; chk[i] = 1; f(i); } }
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 | Correct | 29 ms | 200 KB | Output is correct |
4 | Correct | 29 ms | 312 KB | Output is correct |
5 | Correct | 30 ms | 200 KB | Output is correct |
6 | Correct | 31 ms | 292 KB | Output is correct |
7 | Correct | 29 ms | 304 KB | Output is correct |
8 | Correct | 30 ms | 200 KB | Output is correct |
9 | Correct | 30 ms | 300 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Incorrect | 0 ms | 200 KB | Wrong Answer [6] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Incorrect | 0 ms | 200 KB | Wrong Answer [6] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Incorrect | 0 ms | 200 KB | Wrong Answer [6] |
3 | 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 | 29 ms | 200 KB | Output is correct |
4 | Correct | 29 ms | 312 KB | Output is correct |
5 | Correct | 30 ms | 200 KB | Output is correct |
6 | Correct | 31 ms | 292 KB | Output is correct |
7 | Correct | 29 ms | 304 KB | Output is correct |
8 | Correct | 30 ms | 200 KB | Output is correct |
9 | Correct | 30 ms | 300 KB | Output is correct |
10 | Correct | 0 ms | 200 KB | Output is correct |
11 | Incorrect | 0 ms | 200 KB | Wrong Answer [6] |
12 | Halted | 0 ms | 0 KB | - |