Submission #945211

#TimeUsernameProblemLanguageResultExecution timeMemory
945211onepunchac168Super Dango Maker (JOI22_dango3)C++17
2 / 100
723 ms1116 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; vector <int> tmp[25]; #define pb push_back void Solve(int n, int m) { int dem=0; vector <int> target; for (int i=1;i<=n*m;i++) { target.push_back(i); } while (m>5) { dem++; vector <int> need; vector <int> needa; for (int i=0;i<target.size();i++) { vector <int> cnt; for (int j=i+1;j<target.size();j++) { cnt.push_back(target[j]); } for (auto v:need) { cnt.push_back(v); } if (Query(cnt)>=m-5) { needa.pb(target[i]); } else need.pb(target[i]); } for (auto v:needa) { tmp[dem].pb(v); } m-=5; } if (m>0) { dem++; for (auto v:target) { tmp[dem].push_back(v); } } for (int i=1;i<=dem;i++) { vector <int> rr=tmp[i]; int kk=rr.size()/n; while (rr.size()>n) { kk--; vector <int> need; vector <int> needa; for (int i=0;i<rr.size();i++) { vector <int> cnt; for (int j=i+1;j<rr.size();j++) { cnt.push_back(rr[j]); } for (auto v:need) { cnt.push_back(v); } if (Query(cnt)>=kk) { needa.pb(rr[i]); } else need.pb(rr[i]); } Answer(needa); swap(need,rr); } Answer(rr); } }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:19:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |         for (int i=0;i<target.size();i++)
      |                      ~^~~~~~~~~~~~~~
dango3.cpp:22:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |             for (int j=i+1;j<target.size();j++)
      |                            ~^~~~~~~~~~~~~~
dango3.cpp:54:25: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   54 |         while (rr.size()>n)
      |                ~~~~~~~~~^~
dango3.cpp:59:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   59 |             for (int i=0;i<rr.size();i++)
      |                          ~^~~~~~~~~~
dango3.cpp:62:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   62 |                 for (int j=i+1;j<rr.size();j++)
      |                                ~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...