Submission #905214

#TimeUsernameProblemLanguageResultExecution timeMemory
905214MinaRagy06Super Dango Maker (JOI22_dango3)C++17
0 / 100
508 ms604 KiB
#include <bits/stdc++.h> #include "dango3.h" #ifdef MINA #include "grader.cpp" #endif using namespace std; #define ll long long void Solve(int n, int m) { vector<int> v[m]; auto getmx = [&] (vector<int> &x) { sort(x.begin(), x.end()); int ptr = 0; vector<int> y; for (int i = 1; i <= n * m; i++) { while (ptr < x.size() && x[ptr] < i) { ptr++; } if (ptr < x.size() && x[ptr] == i) continue; y.push_back(i); } return Query(y); }; for (int i = 1; i <= n * m; i++) { int l = 0, r = m - 1; while (l <= r) { int md = ((l + r) >> 1); v[md].push_back(i); int mx = getmx(v[md]); v[md].pop_back(); if (mx == 1) { r = md - 1; } else { l = md + 1; } } v[l].push_back(i); } for (auto i : v) { Answer(i); } }

Compilation message (stderr)

dango3.cpp: In lambda function:
dango3.cpp:16:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |    while (ptr < x.size() && x[ptr] < i) {
      |           ~~~~^~~~~~~~~~
dango3.cpp:19:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |    if (ptr < x.size() && x[ptr] == i) 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...