Submission #1112046

#TimeUsernameProblemLanguageResultExecution timeMemory
1112046onlk97Super Dango Maker (JOI22_dango3)C++17
100 / 100
124 ms780 KiB
#include "dango3.h" #include <bits/stdc++.h> #include <vector> using namespace std; const int THRES=2000; namespace { int variable_example = 1; } // namespace void Solve(int N, int M){ random_device rd; mt19937 mt(rd()); vector <int> rem; for (int i=1; i<=N*M; i++) rem.push_back(i); for (int i=1; i<M; i++){ br:; shuffle(rem.begin(),rem.end(),mt); vector <int> v; vector <int> orirem=rem; for (int j=0; j<THRES&&!rem.empty(); j++){ v.push_back(rem.back()); rem.pop_back(); } if (!Query(v)){ for (int j:v) rem.push_back(j); goto br; } while (v.size()>N){ vector <int> tp=v; int ba=tp.back(); tp.pop_back(); if (!Query(tp)) tp.insert(tp.begin(),ba); v=tp; } set <int> sv; for (int j:v) sv.insert(j); vector <int> nw; rem=orirem; for (int j:rem){ if (sv.find(j)==sv.end()) nw.push_back(j); } rem=nw; Answer(v); } Answer(rem); }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:30:24: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   30 |         while (v.size()>N){
      |                ~~~~~~~~^~
dango3.cpp: At global scope:
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...