Submission #869641

#TimeUsernameProblemLanguageResultExecution timeMemory
869641willychanSuper Dango Maker (JOI22_dango3)C++17
2 / 100
739 ms1048576 KiB
#include "dango3.h" #include <vector> #include<random> #include<algorithm> #include<iostream> #include<cassert> using namespace std; namespace { int variable_example = 1; int n,m; } // namespace void ans(vector<int> pos){ if(pos.size()==n){Answer(pos);return;} random_shuffle(pos.begin(),pos.end()); vector<int> l; vector<int> r; vector<bool> nin(pos.size(),0); int k = (pos.size()/n)/2; int cnt = 0; for(int i=0;i<pos.size();i++){ if(cnt==k*n) break; vector<int> q; nin[i]=1; for(int j=0;j<pos.size();j++){ if(!nin[j]) q.push_back(pos[j]); } if(Query(q)<k) nin[i]=0; else{ cnt++; } } for(int i=0;i<pos.size();i++){ if(nin[i]) l.push_back(pos[i]); else r.push_back(pos[i]); } ans(l); ans(r); } void Solve(int N, int M) { n = N;m = M; vector<int> pos; for(int i=1;i<=N*M;i++){ pos.push_back(i); } ans(pos); }

Compilation message (stderr)

dango3.cpp: In function 'void ans(std::vector<int>)':
dango3.cpp:16:15: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   16 |  if(pos.size()==n){Answer(pos);return;}
      |     ~~~~~~~~~~^~~
dango3.cpp:23:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |  for(int i=0;i<pos.size();i++){
      |              ~^~~~~~~~~~~
dango3.cpp:27:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |   for(int j=0;j<pos.size();j++){
      |               ~^~~~~~~~~~~
dango3.cpp:35:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |  for(int i=0;i<pos.size();i++){
      |              ~^~~~~~~~~~~
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...