Submission #582740

#TimeUsernameProblemLanguageResultExecution timeMemory
582740elkernosSuper Dango Maker (JOI22_dango3)C++17
100 / 100
4131 ms940 KiB
#include "dango3.h" using namespace std; namespace { int S; int q(vector<bool> b) { vector<int> x; for(int i = 0; i < S; i++) { if(b[i]) x.push_back(i + 1); } return Query(x); } void a(vector<int> v) { for(auto &t : v) { t++; } Answer(v); } } // namespace void Solve(int N, int M) { S = N * M; vector<vector<int>> box(M); for(int i = 0; i < S; i++) { int lo = 0, hi = M - 1, ans = -1; while(lo <= hi) { int m = (lo + hi) / 2; vector<bool> query(S, 1); for(int x : box[m]) { query[x] = 0; } query[i] = 0; if(M - q(query) == 2) { lo = m + 1; } else { ans = m; hi = m - 1; } } box[ans].push_back(i); } for(vector<int> give : box) { a(give); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...