Submission #996295

#TimeUsernameProblemLanguageResultExecution timeMemory
996295abczzSuper Dango Maker (JOI22_dango3)C++17
7 / 100
111 ms1128 KiB
#include "dango3.h" #include <iostream> #include <vector> #include <map> #include <random> #include <algorithm> #define ll int using namespace std; void Solve(int N, int M) { mt19937_64 mt(69); vector <ll> perm; map <ll, ll> mp; ll pos[10001]; ll s; for (int i=1; i<=N*M; ++i) { perm.push_back(i); } shuffle(perm.begin(), perm.end(), mt); for (int i=0; i<N*M; ++i) { mp[i] = perm[i]; pos[perm[i]] = i; } vector <ll> V; for (int i=0; i<M; ++i) { for (auto [x, y] : mp) { V.push_back(y); if (V.size() >= N) { s = Query(V); if (s) break; } } for (int j=0; j<(ll)V.size(); ++j) { auto u = V[j]; swap(V[j], V.back()); V.pop_back(); s = Query(V); if (!s) { V.push_back(u); swap(V[j], V.back()); } else --j; if (V.size() == N) break; } for (auto u : V) { mp.erase(pos[u]); } Answer(V); V.clear(); } }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:29:20: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   29 |       if (V.size() >= N) {
      |           ~~~~~~~~~^~~~
dango3.cpp:44:20: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   44 |       if (V.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...