Submission #988576

#TimeUsernameProblemLanguageResultExecution timeMemory
988576toan2602Super Dango Maker (JOI22_dango3)C++17
22 / 100
317 ms600 KiB
#include<bits/stdc++.h> #include "dango3.h" using namespace std; vector<int> ans, v2, x; bool mark[100005]; void Solve(int n, int m) { for (int Q = 1; Q <= m; Q++) { x.clear(); for (int i = n * m; i >= 1; i--) if(!mark[i]) x.push_back(i); ans.clear(); v2 = x; while(!x.empty()) { int l = 0, r = x.size() - 1, mid, mx = 0; while(l <= r) { v2.clear(); mid = (l + r) / 2; for (int i = 0; i < x.size() - mid; i++) { v2.push_back(x[i]); } for (int i: ans) v2.push_back(i); if(Query(v2) == 0) r = mid - 1; else { l = mid + 1; mx = max(mx, mid); } } for (int i = 1; i <= mx; i++) { x.pop_back(); } mark[x.back()] = true; ans.push_back(x.back()); x.pop_back(); if(ans.size() == n) break; } Answer(ans); } }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:21:35: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |                 for (int i = 0; i < x.size() - mid; i++) {
      |                                 ~~^~~~~~~~~~~~~~~~
dango3.cpp:37:27: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   37 |             if(ans.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...