Submission #1127697

#TimeUsernameProblemLanguageResultExecution timeMemory
1127697KK_1729Super Dango Maker (JOI22_dango3)C++20
22 / 100
6234 ms704 KiB
#include <bits/stdc++.h> using namespace std; #include "dango3.h" #define FOR(i,a,b) for (int i = (a); i < (b); ++i) #define pb push_back #define all(a) a.begin(), a.end() #include <vector> namespace { int variable_example = 1; } // namespace void Solve(int N, int M) { vector<vector<int>> groups(M); FOR(i,1,N*M+1){ int l = 0; int r = M-1; int u = -1; while (l < r){ int mid = (l+r)/2; set<int> j; vector<int> e; for (auto x: groups[mid]) j.insert(x); FOR(k,1,N*M+1){ if (j.count(k) == 0 && k != i) e.pb(k); } int o = M-Query(e); if (o == 2){ if (l+1 == r){ u = r; break; } l = mid; }else{ if (l+1 == r) u = l; r = mid; } } groups[u].pb(i); } FOR(i,0,M){ Answer(groups[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...