Submission #956027

#TimeUsernameProblemLanguageResultExecution timeMemory
956027MarwenElarbiSuper Dango Maker (JOI22_dango3)C++17
100 / 100
6298 ms1544 KiB
#include <bits/stdc++.h> #include "dango3.h" #include <vector> using namespace std; namespace { int variable_example = 1; } set<int> colors[25]; void Solve(int N, int M){ int n=N; int m=M; //cout <<n<<" "<<m<<endl; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { int l=-1; int r=m-1; while(r-l>1){ int mid=(r+l)/2; vector<int> cur; for (int k = 1; k <= n*m; ++k) { if(k==i*m+j+1) continue; if(colors[mid].count(k)) continue; cur.push_back(k); } int res=Query(cur); if(m-res>1) l=mid; else r=mid; } //for(auto u:colors[0]) cout <<u<<" "; //cout <<endl; vector<int> cur; for (int k = 1; k <= n*m; ++k) { if(k==i*m+j+1) continue; if(colors[r].count(k)) continue; cur.push_back(k); } //cout <<r<<" "<<Query(cur)<<" "<<i*m+j+1<<" "<<i<<" "<<j<<endl; colors[r].insert(i*m+j+1); } } vector<int> ans[m]; for (int i = 0; i < m; ++i) { //cout <<colors[i].size()<<endl; for(auto u:colors[i]) ans[i].push_back(u); } for (int i = 0; i < m; ++i) { Answer(ans[i]); } }

Compilation message (stderr)

dango3.cpp:8:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    8 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...