Submission #973658

#TimeUsernameProblemLanguageResultExecution timeMemory
973658happy_nodeSuper Dango Maker (JOI22_dango3)C++17
100 / 100
2189 ms1172 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; const int MX=400*25+5; bool used[MX]; int N,M; vector<vector<int>> groups; bool chk(int l, int r, int z) { for(int i=l;i<=r;i++) { for(auto x:groups[i]) used[x]=true; } used[z]=true; vector<int> qry; for(int j=1;j<=N*M;j++) { if(!used[j]) qry.push_back(j); } for(int i=l;i<=r;i++) { for(auto x:groups[i]) used[x]=false; } used[z]=false; int k=Query(qry); return k==M-(r-l+1); } int dnc(int l, int r, int z) { if(l==r) return l; int mid=(l+r)/2; if(chk(l,mid,z)) return dnc(l,mid,z); return dnc(mid+1,r,z); } void Solve(int NN, int MM) { N=NN, M=MM; groups.push_back({1}); for(int i=2;i<=N*M;i++) { int res=dnc(0,groups.size(),i); if(res==groups.size()) { groups.push_back({i}); } else { groups[res].push_back(i); } } for(auto v:groups) { Answer(v); } }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:46:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |                 if(res==groups.size()) {
      |                    ~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...