Submission #620048

#TimeUsernameProblemLanguageResultExecution timeMemory
620048czhang2718Super Dango Maker (JOI22_dango3)C++17
0 / 100
16 ms468 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; void Solve(int N, int M) { vector<vector<int>> dango(M); for(int i=1; i<=N*M; i++){ auto check=[&](int k)->bool{ dango[k-1].push_back(i); int r=Query(dango[k-1]); dango[k-1].pop_back(); return r==dango[k-1].size(); }; int j=0; for(int k=31-__builtin_clz(M); k>=0; k--){ if(j+(1<<k)<M && check(j+(1<<k))) j+=(1<<k); } dango[j].push_back(i); } for(int i=0; i<M; i++) Answer(dango[i]); }

Compilation message (stderr)

dango3.cpp: In lambda function:
dango3.cpp:12:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |       return r==dango[k-1].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...