# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
551888 | 2022-04-21T19:59:08 Z | Antekb | Super Dango Maker (JOI22_dango3) | C++17 | 446 ms | 712 KB |
#include "dango3.h" #include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); namespace{ } void Solve(int N, int M) { vector<int> V(N*M); for(int i=0; i<N*M; i++){ V[i]=i+1; } for(int j=0; j<M; j++){ shuffle(V.begin(), V.end(), rng); vector<int> V2; int l=1, r=V.size(); while(l<r){ int m=(l+r)>>1; V2=V; V2.resize(m); if(Query(V2))r=m; else l=m+1; } V2.clear(); vector<int> V3; while(V.size()>l){ V3.push_back(V.back()); V.pop_back(); } while(V.size()){ int x=V.back(); V.pop_back(); //cerr<<V.size()<<"a\n"; for(int i:V2)V.push_back(i); //cerr<<V.size()<<"a\n"; int b=Query(V); //cerr<<V.size()<<"a\n"; for(int i:V2)V.pop_back(); //cerr<<V.size()<<"a\n"; if(!b)V2.push_back(x); else V3.push_back(x); } assert(V2.size()==N); Answer(V2); V=V3; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 0 ms | 340 KB | Output is correct |
5 | Correct | 1 ms | 340 KB | Output is correct |
6 | Correct | 0 ms | 340 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 316 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 5 ms | 340 KB | Output is correct |
4 | Correct | 5 ms | 340 KB | Output is correct |
5 | Correct | 5 ms | 340 KB | Output is correct |
6 | Correct | 4 ms | 380 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 76 ms | 472 KB | Output is correct |
2 | Correct | 72 ms | 476 KB | Output is correct |
3 | Correct | 70 ms | 468 KB | Output is correct |
4 | Correct | 72 ms | 472 KB | Output is correct |
5 | Correct | 79 ms | 476 KB | Output is correct |
6 | Correct | 70 ms | 472 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 389 ms | 712 KB | Output is correct |
2 | Correct | 422 ms | 612 KB | Output is correct |
3 | Correct | 393 ms | 704 KB | Output is correct |
4 | Correct | 433 ms | 604 KB | Output is correct |
5 | Correct | 446 ms | 600 KB | Output is correct |
6 | Correct | 375 ms | 600 KB | Output is correct |