Submission #951696

#TimeUsernameProblemLanguageResultExecution timeMemory
951696Darren0724Super Dango Maker (JOI22_dango3)C++17
100 / 100
195 ms816 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; const int N=10005; void Solve(int n, int m) { vector<int> vis(N); for (int i = 0; i < m; i++) { vector<int> a; for(int j=1;j<=n*m;j++){ if(!vis[j]){ a.push_back(j); } } shuffle(a.begin(),a.end(),mt19937(time(0))); int sz=a.size(); int l=0,r=sz; while(r-l>1){ int m=(l+r)>>1; if(Query(vector(a.begin(),a.begin()+m))>=1){ r=m; } else{ l=m; } } vector<int> t(sz); for(int j=0;j<r;j++){ t[j]=1; } for(int j=0;j<r;j++){ t[j]=0; vector<int> v; for(int k=0;k<r;k++){ if(t[k]){ v.push_back(a[k]); } } if(Query(v)==0){ t[j]=1; } } vector<int> v; for(int k=0;k<r;k++){ if(t[k]){ v.push_back(a[k]); vis[a[k]]=1; } } Answer(v); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...