Submission #544843

#TimeUsernameProblemLanguageResultExecution timeMemory
544843MarcoMeijerSuper Dango Maker (JOI22_dango3)C++17
7 / 100
10053 ms1416 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; namespace { int query(set<int> st) { vector<int> a; for (int x : st) a.push_back(x); return Query(a); } } // namespace void Solve(int N, int M) { vector<vector<int>> byGroup; byGroup.resize(M); for (int i=1; i<=N*M; i++) { int lb=0, ub=M-1; while (lb != ub) { int mid=(lb+ub+1)/2; set<int> s; for (int j=1; j<=N*M; j++) s.insert(j); for (int j=0; j<mid; j++) for (int x : byGroup[j]) s.erase(x); s.erase(i); int res = query(s); if (res >= M - mid) ub = mid-1; else lb = mid; } byGroup[lb].push_back(i); } for (int i=0; i<M; i++) { Answer(byGroup[i]); } } // #include "grader.cpp"
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...