Submission #544547

#TimeUsernameProblemLanguageResultExecution timeMemory
544547benson1029Super Dango Maker (JOI22_dango3)C++17
100 / 100
1325 ms716 KiB
#include "dango3.h" #include <vector> #include<bits/stdc++.h> using namespace std; namespace { int n, m; bool used[100005]; vector< vector<int> > ans; vector<int> tmp; } // namespace void solve(vector<int> a) { int size = a.size() / n; if(size==1) { ans.push_back(a); return; } else { vector<int> x, y; for(int i=0; i<a.size(); i++) used[i] = true; for(int i=0; i<a.size(); i++) { tmp.clear(); for(int j=0; j<a.size(); j++) { if(j!=i && used[j]) tmp.push_back(a[j]); } int rv = Query(tmp); //cout << rv << " "; if(rv < size/2) { used[i] = true; x.push_back(a[i]); } else { used[i] = false; y.push_back(a[i]); } } //cout << "\n"; solve(x); solve(y); } } void Solve(int N, int M) { srand(1024); n = N; m = M; vector<int> t; t.clear(); for(int i=1; i<=N*M; i++) t.push_back(i); solve(t); for(int i=0; i<M; i++) Answer(ans[i]); }

Compilation message (stderr)

dango3.cpp: In function 'void solve(std::vector<int>)':
dango3.cpp:23:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |   for(int i=0; i<a.size(); i++) used[i] = true;
      |                ~^~~~~~~~~
dango3.cpp:24:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |   for(int i=0; i<a.size(); i++) {
      |                ~^~~~~~~~~
dango3.cpp:26:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |    for(int j=0; j<a.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...