# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
937839 | 2024-03-04T15:09:50 Z | velislavgarkov | Super Dango Maker (JOI22_dango3) | C++17 | 14 ms | 604 KB |
#include "dango3.h" #include <iostream> #include <algorithm> #include <vector> using namespace std; const int MAXN=1e4+10; bool used[MAXN]; void solve(vector <int> a, int n) { if (a.size()==n) { Answer(a); return; } vector <int> q; int l, r, mid; l=0; r=a.size()-1; while (l<r) { mid=(l+r)/2; if (!q.empty()) q.clear(); for (int i=0;i<=mid;i++) q.push_back(a[i]); if (Query(q)==0) l=mid+1; else r=mid; } int ind=l; for (int i=0;i<ind;i++) { if (q.size()==n) break; q.erase(q.begin()); if (Query(q)==0) q.push_back(a[i]); } for (int i=0;i<n;i++) used[q[i]]=true; vector <int> newa; for (int i=0;i<a.size();i++) { if (!used[a[i]]) newa.push_back(a[i]); } Answer(q); solve(newa,n); } void Solve(int N, int M) { int n, m; n=N; m=M; vector <int> a; for (int i=1;i<=n*m;i++) a.push_back(i); random_shuffle(a.begin(),a.end()); solve(a,n); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 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 | 5 ms | 604 KB | Wrong Answer [4] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 14 ms | 600 KB | Wrong Answer [4] |
2 | Halted | 0 ms | 0 KB | - |