Submission #1077918

#TimeUsernameProblemLanguageResultExecution timeMemory
10779180npataSuper Dango Maker (JOI22_dango3)C++17
100 / 100
1905 ms1408 KiB
#include "dango3.h" #include<bits/stdc++.h> using namespace std; #define vec vector const int MXSZ = 400*25; void Solve(int N, int M) { vec<int> all(N*M); iota(all.begin(), all.end(), 1); function<void(vec<int>)> divandconq = [&](vec<int> v) { if(v.size() == N){ Answer(v); return; } vec<int> v1{}; vec<int> v2{}; set<int> cur; for(int i : v) cur.insert(i); int tm = (v.size()/N)/2; for(int i = 0; i<v.size(); i++) { cur.erase(v[i]); if(Query(vec<int>(cur.begin(), cur.end())) >= tm) { v1.push_back(v[i]); } else { v2.push_back(v[i]); cur.insert(v[i]); } } divandconq(v1); divandconq(v2); }; divandconq(all); }

Compilation message (stderr)

dango3.cpp: In lambda function:
dango3.cpp:14:21: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   14 |         if(v.size() == N){
      |            ~~~~~~~~~^~~~
dango3.cpp:25:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |         for(int i = 0; i<v.size(); 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...