Submission #554611

#TimeUsernameProblemLanguageResultExecution timeMemory
554611ArvinSuper Dango Maker (JOI22_dango3)C++17
7 / 100
390 ms504 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; //namespace { // int variable_example = 1; //} // namespace void Solve(int n, int m) { int len = n*m; vector<int> v; for(int x=0;x<len;x++){ v.push_back(x+1); } int lst = len-1; for(int x=len-1;x>=0;x--){ int res = Query(v); if(res >= 1){ lst = x; } v.pop_back(); } bool valid[len]; fill(valid, valid+len, false); for(int x=0;x<=lst;x++) valid[x] = true; for(int x=0;x<=lst;x++){ valid[x] ^= 1; vector<int> w; for(int y=0;y<=lst;y++){ if(valid[y]){ w.push_back(y+1); } } int res = Query(w); if(res >= 1){ continue; } valid[x] ^= 1; } int c[len]; fill(c, c+len, -1); v.clear(); for(int x=0;x<=lst;x++){ if(valid[x]){ v.push_back(x+1); } } for(int x=0;x<v.size();x++){ c[v[x]-1] = x; } for(int x=0;x<v.size();x++){ vector<int> w; for(int y=0;y<x;y++){ w.push_back(v[y]); } for(int y=x+1;y<v.size();y++){ w.push_back(v[y]); } for(int y=0;y<len;y++){ if(c[y] == -1){ w.push_back(y+1); if(Query(w) >= 1){ c[y] = c[v[x]-1]; } w.pop_back(); } } } vector<int> ans[n]; for(int x=0;x<len;x++){ ans[c[x]].push_back(x); } for(int x=0;x<m;x++){ vector<int> w; for(int y=0;y<n;y++){ w.push_back(ans[y][x]+1); } Answer(w); } // vector<int> x(3); // x[0] = 1; // x[1] = 2; // x[2] = 3; // variable_example = Query(x); // for (int i = 0; i < M; i++) { // std::vector<int> a(N); // for (int j = 0; j < N; j++) { // a[j] = N * i + j + 1; // } // Answer(a); // } }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:60:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   60 |  for(int x=0;x<v.size();x++){
      |              ~^~~~~~~~~
dango3.cpp:64:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   64 |  for(int x=0;x<v.size();x++){
      |              ~^~~~~~~~~
dango3.cpp:69:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   69 |   for(int y=x+1;y<v.size();y++){
      |                 ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...