Submission #958554

#TimeUsernameProblemLanguageResultExecution timeMemory
958554gaga999Super Dango Maker (JOI22_dango3)C++17
100 / 100
1744 ms1116 KiB
#include <bits/stdc++.h> using namespace std; void Solve(int N, int M); int Query(const std::vector<int> &x); void Answer(const std::vector<int> &a); 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>> dangobox(M); for (int i = 0; i < S; i++) { int l, r; l = -1; r = M - 1; while (l + 1 != r) { int m = (l + r) / 2; vector<bool> b(S, true); for (int j = 0; j <= m; j++) { for (int t : dangobox[j]) { b[t] = false; } } b[i] = false; if (q(b) == M - m - 2) l = m; else r = m; } dangobox[r].push_back(i); } for (int i = 0; i < M; i++) { a(dangobox[i]); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...