# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1031832 | 2024-07-23T07:52:43 Z | aymanrs | Chameleon's Love (JOI20_chameleon) | C++14 | 1 ms | 344 KB |
#include "chameleon.h" #include <bits/stdc++.h> using namespace std; void Solve(int N) { bool v[2*N+1] = {false}; int p = 1; vector<int> s = {1}; for(int i = 2;i <= 2*N;i++){ s.push_back(i); if(Query(s) > p){ p++; continue; } p--; int l = 0, r = s.size()-2, m, b = -1; while(l<r){ m = l+r>>1; swap(s[m+1], s.back()); if(Query(vector<int>(s.begin()+l, s.begin()+m+2)) == m-l+1) l = m+1; else r=m; swap(s[m+1], s.back()); } Answer(i, l); s.pop_back(); s.erase(s.begin()+l); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Wrong Answer [4] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Wrong Answer [4] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Wrong Answer [4] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Wrong Answer [4] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Wrong Answer [4] |
2 | Halted | 0 ms | 0 KB | - |