Submission #936831

#TimeUsernameProblemLanguageResultExecution timeMemory
936831TAhmed33Super Dango Maker (JOI22_dango3)C++17
0 / 100
164 ms880 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; int n, m; int get (vector <int> &x) { set <int> dd; for (auto i : x) dd.insert(i); vector <int> l; for (int i = 1; i <= n * m; i++) { if (!dd.count(i)) l.push_back(i); } return m - Query(l); } void Solve (int N, int M) { n = N; m = M; vector <int> cur[m + 1]; for (int i = 1; i <= n * m; i++) { int l = 1, r = m, ans = -1; while (l <= r) { int mid = (l + r) / 2; if (get(cur[mid]) == 2) { l = mid + 1; } else { r = mid - 1; ans = mid; } } assert(ans != -1); cur[ans].push_back(i); } for (int i = 1; i <= m; i++) { Answer(cur[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...