Submission #905219

#TimeUsernameProblemLanguageResultExecution timeMemory
905219Ahmed57Super Dango Maker (JOI22_dango3)C++17
100 / 100
2000 ms1200 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; /* min freq max freq */ void Solve(int n,int m){ vector<int> v[m]; int cnt = 0; int taked[n*m+1] = {0}; for(int i = 1;i<=n*m;i++){ int l = 0 , r = m-1 , ans = 0; while(l<=r){ int mid = (l+r)/2; vector<int> d; cnt++; taked[i] = cnt; for(int j = 0;j<=mid;j++){ for(auto e:v[j]){ taked[e] = cnt; } } vector<int> qu; for(int j = 1;j<=n*m;j++){ if(taked[j]!=cnt){ qu.push_back(j); } } if(m-Query(qu)<=mid+1){ ans = mid; r = mid-1; }else l = mid+1; } v[ans].push_back(i); } for(int i =0;i<m;i++){ Answer(v[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...