Submission #589690

#TimeUsernameProblemLanguageResultExecution timeMemory
589690LastRoninSuper Dango Maker (JOI22_dango3)C++17
100 / 100
1845 ms668 KiB
#include "dango3.h" #include <bits/stdc++.h> #include <vector> #define pb push_back using namespace std; mt19937_64 bruh(chrono::steady_clock::now().time_since_epoch().count()); namespace { int variable_example = 1; } // namespace void Solve(int N, int M) { vector<int> x; for(int i = 0; i < N; i++) { for(int j = 0; j < M; j++) { x.pb(M * i + j + 1); } } int kek = 0; vector<int> y; while(kek < M) { shuffle(x.begin(), x.end(), bruh); int za = Query(x); int f = x.size(); vector<int> ans; if(kek <= 25 ) { ans.pb(x.back()); x.pop_back(); for(int j = f - 2; j >= 0; j--) { int mem = x.back(); x.pop_back(); for(auto u : y) x.pb(u); int answ = Query(x); for(auto u : y)x.pop_back(); if(answ == za - 2) y.pb(mem); else ans.pb(mem); if(ans.size() == N)break; } for(auto u : x)y.pb(u); x = y; y.clear(); } else { ans.pb(x.back()); x.pop_back(); for(int j = f - 2; j >= 0; j--) { int mem = x.back(); x.pop_back(); for(auto u : y) x.pb(u); int answ = Query(x); for(auto u : y)x.pop_back(); if(answ == za - 2) y.pb(mem); else ans.pb(mem); } x = y; y.clear(); } kek++; Answer(ans); } }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:37:14: warning: unused variable 'u' [-Wunused-variable]
   37 |     for(auto u : y)x.pop_back();
      |              ^
dango3.cpp:40:19: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   40 |     if(ans.size() == N)break;
      |        ~~~~~~~~~~~^~~~
dango3.cpp:54:14: warning: unused variable 'u' [-Wunused-variable]
   54 |     for(auto u : y)x.pop_back();
      |              ^
dango3.cpp: At global scope:
dango3.cpp:11:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   11 | 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...