Submission #783120

#TimeUsernameProblemLanguageResultExecution timeMemory
783120JooDdaeSuper Dango Maker (JOI22_dango3)C++17
22 / 100
870 ms980 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; using ll = long long; int m; vector<int> done, imsi; vector<int> type[404]; int query(vector<int> q) { for(auto x : done) q.push_back(x); for(auto x : imsi) q.push_back(x); return Query(q); } void find(int u, vector<int> v) { int s = v.size(); if(s == 1) { // cout << "add " << v[0] << "\n"; type[u].push_back(v[0]); return; } vector<int> v1 = vector<int>(v.begin(), v.begin()+s/2), v2 = vector<int>(v.begin()+s/2, v.end()); int re = query(v1); if(re) find(u, v1); else { for(auto x : v1) imsi.push_back(x); } if(type[u].size() < m && (!re || query(v2))) find(u, v2); else { for(auto x : v2) imsi.push_back(x); } } void Solve(int N, int M) { m = M; vector<int> v(N*M); iota(v.begin(), v.end(), 1); random_device rd; shuffle(v.begin(), v.end(), mt19937(rd())); for(int i=0;i<N-1;i++) { find(i, v); for(auto x : type[i]) done.push_back(x); for(auto x : type[i]) v.erase(find(v.begin(), v.end(), x)); imsi.clear(); // for(auto x : v) cout << x << " "; // cout << i << " " << v.size(); // cout << "DONE------------" << endl; } type[N-1] = v; for(int i=0;i<M;i++) { vector<int> re; for(int j=0;j<N;j++) { re.push_back(type[j][i]); } Answer(re); } }

Compilation message (stderr)

dango3.cpp: In function 'void find(int, std::vector<int>)':
dango3.cpp:33:23: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   33 |     if(type[u].size() < m && (!re || query(v2))) find(u, v2);
      |        ~~~~~~~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...