Submission #768698

#TimeUsernameProblemLanguageResultExecution timeMemory
768698NintsiChkhaidzeSuper Dango Maker (JOI22_dango3)C++17
100 / 100
2200 ms720 KiB
#include "dango3.h" #include <bits/stdc++.h> #define pb push_back using namespace std; bool f[400*25 + 5]; vector <int> v[30]; void Solve(int N, int M) { vector<int> x; for (int i = 1; i <= N*M; i++){ int l = 1,r = M,res; while (l <= r){ int mid = (l + r)>>1; vector <int> f(N*M + 1,1); for (int j = 1; j <= mid; j++){ for (int x: v[j]) { f[x] = 0; } } f[i] = 0; vector <int> vec; for (int j = 1; j <= N*M; j++) if (f[j]) vec.pb(j); int ans = Query(vec); if (M - ans > mid) { l = mid + 1; }else{ r = mid - 1; res = mid; } } v[res].pb(i); } for (int j = 1; j <= M; j++){ Answer(v[j]); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...