# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1095178 | 2024-10-01T13:30:48 Z | thangdz2k7 | Super Dango Maker (JOI22_dango3) | C++17 | 2924 ms | 900 KB |
// author : thembululquaUwU // 3.9.2024 #include <bits/stdc++.h> #include "dango3.h" #define pb push_back #define fi first #define se second #define endl '\n' using namespace std; using ll = long long; using ii = pair <int, int>; using vi = vector <int>; const int MaxN = 2e5; const int mod = 1e9 + 7; void maxl(auto &a, auto b) {a = max(a, b);} void minl(auto &a, auto b) {a = min(a, b);} bool w(vector <int> v, int N, int M){ vi used(N * M, 0); for (int &t : v) used[t - 1] = 1; vi inv; for (int i = 0; i < N * M; ++ i) if (!used[i]) inv.pb(i + 1); return (M - Query(inv) == 1); } void Solve(int N, int M){ vector <vi> ans(M); for (int i = 0; i < N * M; ++ i){ int l = 1, r = M - 1, res = 0; while (l <= r){ int mid = l + r >> 1; vi T = ans[mid]; T.pb(i + 1); if (w(T, N, M)) res = mid, r = mid - 1; else l = mid + 1; } ans[res].pb(i + 1); } for (int i = 0; i < M; ++ i) Answer(ans[i]); } //void solve(){ // //} // //int main(){ // if (fopen("pqh.inp", "r")){ // freopen("pqh.inp", "r", stdin); // freopen("pqh.out", "w", stdout); // } // ios_base::sync_with_stdio(0); // cin.tie(0); cout.tie(0); // // int t = 1; // cin >> t; // while (t --) solve(); // return 0; //}
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 440 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 344 KB | Output is correct |
2 | Correct | 15 ms | 444 KB | Output is correct |
3 | Correct | 11 ms | 348 KB | Output is correct |
4 | Correct | 11 ms | 516 KB | Output is correct |
5 | Correct | 11 ms | 348 KB | Output is correct |
6 | Correct | 11 ms | 528 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 533 ms | 900 KB | Output is correct |
2 | Correct | 520 ms | 600 KB | Output is correct |
3 | Correct | 562 ms | 848 KB | Output is correct |
4 | Correct | 563 ms | 848 KB | Output is correct |
5 | Correct | 501 ms | 604 KB | Output is correct |
6 | Correct | 505 ms | 796 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2789 ms | 772 KB | Output is correct |
2 | Correct | 2712 ms | 784 KB | Output is correct |
3 | Correct | 2879 ms | 820 KB | Output is correct |
4 | Correct | 2883 ms | 796 KB | Output is correct |
5 | Correct | 2877 ms | 772 KB | Output is correct |
6 | Correct | 2924 ms | 772 KB | Output is correct |