Submission #1033249

#TimeUsernameProblemLanguageResultExecution timeMemory
1033249adaawfSuper Dango Maker (JOI22_dango3)C++17
100 / 100
2404 ms1580 KiB
#include <bits/stdc++.h> #include "dango3.h" using namespace std; /*void Print(vector<int> v) { for (int w : v) cout << w << " "; cout << '\n'; } int Query(vector<int> v) { Print(v); int k; cin >> k; return k; } void Answer(vector<int> v) { Print(v); } void Solve(int n, int m); int main() { int n = 4, m = 4; Solve(n, m); }*/ int dd[26][10005]; void Solve(int n, int m) { vector<vector<int>> res(m); for (int i = 1; i <= n * m; i++) { int l = 0, r = m, h = m - 1; while (l <= r) { int mid = (l + r) / 2; vector<int> v; for (int j = 1; j <= n * m; j++) { if (dd[mid][j] == 1 || i == j) continue; v.push_back(j); } if (Query(v) == m - 2) { l = mid + 1; } else { h = mid; r = mid - 1; } } res[h].push_back(i); dd[h][i] = 1; } for (auto w : res) Answer(w); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...