Submission #971695

#TimeUsernameProblemLanguageResultExecution timeMemory
97169512345678Super Dango Maker (JOI22_dango3)C++17
22 / 100
2122 ms808 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; const int nx=1e4+5; mt19937 rng(time(0)); int used[nx], n, m, p[nx]; vector<pair<int, int>> s; int query() { vector<int> qrs; for (int i=1; i<=n*m; i++) if (!used[i]) qrs.push_back(i); return Query(qrs); } void Solve(int N, int M) { n=N, m=M; vector<pair<int, int>> s; for (int i=1; i<=N*M; i++) s.push_back({rng(), i}); sort(s.begin(), s.end()); for (int i=1; i<=N*M; i++) p[s[i-1].second]=i; for (int i=M; i>=2; i--) { vector<int> res; for (int j=1; j<=N*M; j++) { if (res.size()==N) break; if (used[p[j]]) continue; used[p[j]]=1; if (query()==i-1) res.push_back(p[j]); else used[p[j]]=0; } Answer(res); } vector<int> res; for (int i=1; i<=N*M; i++) if (!used[p[i]]) res.push_back(p[i]); Answer(res); }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:31:27: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   31 |             if (res.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...