# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
943160 | 2024-03-11T08:53:05 Z | MilosMilutinovic | Chameleon's Love (JOI20_chameleon) | C++14 | 7 ms | 596 KB |
#include "chameleon.h" #include<bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; namespace { int variable_example = 1; } // namespace void Solve(int n){ vector<int> v; vector<pair<int,int>> res; for(int i=1;i<=2*n;i++){ v.pb(i); if(Query(v)!=v.size()){ v.pop_back(); int l=0,r=(int)v.size()-1,p=0; while(l<=r){ int mid=(l+r)/2; vector<int> qv(1,i); for(int j=mid;j<v.size();j++) qv.pb(v[j]); if(Query(qv)!=qv.size()) p=mid,l=mid+1; else r=mid-1; } res.pb(mp(i,v[p])); vector<int> nv; for(int j=0;j<v.size();j++) if(j!=p) nv.pb(v[j]); v=nv; } } for(auto&p:res) Answer(p.fi,p.se); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 7 ms | 344 KB | Output is correct |
4 | Correct | 7 ms | 344 KB | Output is correct |
5 | Correct | 7 ms | 344 KB | Output is correct |
6 | Correct | 7 ms | 456 KB | Output is correct |
7 | Correct | 7 ms | 344 KB | Output is correct |
8 | Correct | 7 ms | 344 KB | Output is correct |
9 | Correct | 7 ms | 344 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 344 KB | Wrong Answer [6] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 344 KB | Wrong Answer [6] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 596 KB | Output is correct |
2 | Incorrect | 0 ms | 344 KB | Wrong Answer [6] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 7 ms | 344 KB | Output is correct |
4 | Correct | 7 ms | 344 KB | Output is correct |
5 | Correct | 7 ms | 344 KB | Output is correct |
6 | Correct | 7 ms | 456 KB | Output is correct |
7 | Correct | 7 ms | 344 KB | Output is correct |
8 | Correct | 7 ms | 344 KB | Output is correct |
9 | Correct | 7 ms | 344 KB | Output is correct |
10 | Correct | 0 ms | 344 KB | Output is correct |
11 | Incorrect | 0 ms | 344 KB | Wrong Answer [6] |
12 | Halted | 0 ms | 0 KB | - |