Submission #554619

#TimeUsernameProblemLanguageResultExecution timeMemory
554619ArvinSuper Dango Maker (JOI22_dango3)C++17
22 / 100
571 ms576 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 cnt = m; while(cnt > 0){ vector<int> w = v; int lst = 0; int left = 0, right = w.size()-1; while(left <= right){ int mid = (left+right) >> 1; vector<int> z; for(int x=0;x<=mid;x++){ z.push_back(w[x]); } if(Query(z) > 0){ lst = mid; right = mid-1; } else { left = mid+1; } } vector<int> ans; int pos = 0; while(pos < lst){ int bound = 0; int left = pos, right = lst; while(left <= right){ int mid = (left+right) >> 1; vector<int> z = ans; for(int x=mid;x<=lst;x++){ z.push_back(w[x]); } if(Query(z) > 0){ bound = mid; left = mid+1; } else { right = mid-1; } } ans.push_back(w[bound]); pos = bound+1; } ans.push_back(w[lst]); v.clear(); pos = 0; for(int x=0;x<w.size();x++){ while(pos < ans.size() && ans[pos] < w[x]){ pos++; } if(pos < ans.size() && ans[pos] == w[x]) continue; v.push_back(w[x]); } Answer(ans); cnt--; } // 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:67:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   67 |   for(int x=0;x<w.size();x++){
      |               ~^~~~~~~~~
dango3.cpp:68:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   68 |    while(pos < ans.size() && ans[pos] < w[x]){
      |          ~~~~^~~~~~~~~~~~
dango3.cpp:71:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   71 |    if(pos < ans.size() && ans[pos] == w[x]) continue;
      |       ~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...