Submission #1020645

#TimeUsernameProblemLanguageResultExecution timeMemory
1020645UnforgettableplSuper Dango Maker (JOI22_dango3)C++17
22 / 100
399 ms648 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; namespace { const int SQRT = 5; } // namespace void Solve(int N, int M) { vector<int> idxes(N*M+1);iota(idxes.begin(),idxes.end(),0); for(int round=0;round<M-1;round++){ vector<int> ans; for(int included=N*(M-round);included;included-=SQRT){ vector<int> query; for(int i=1;i<=(included-SQRT);i++)query.emplace_back(idxes[i]); int q = 0; if(!query.empty()){ for(int&i:ans)query.emplace_back(i); q = Query(query); } if(q>=1)continue; for(int inc=included;inc>included-SQRT;inc--){ vector<int> query; for(int i=1;i<inc;i++)query.emplace_back(idxes[i]); int q = 0; if(!query.empty()){ for(int&i:ans)query.emplace_back(i); q = Query(query); } if(q>=1)continue; ans.emplace_back(idxes[inc]); idxes.erase(idxes.begin()+inc); if(ans.size()==N)break; } if(ans.size()==N)break; } Answer(ans); } idxes.erase(idxes.begin()); Answer(idxes); }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:36:18: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(ans.size()==N)break;
      |        ~~~~~~~~~~^~~
dango3.cpp:38:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   38 |    if(ans.size()==N)break;
      |       ~~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...