This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "dango3.h"
#include <bits/stdc++.h>
#define mp make_pair
#define pb emplace_back
#define fi first
#define se second
// #define int long long
#define inf 1e18
#define ick cout<<"ickbmi32.9\n"
using namespace std;
namespace {
int variable_example = 1;
} // namespace
vector<int> dk;
vector<int> pre;
int n, m;
vector<int> sure[35];
bool har[10005];
int ask(int k, int l, int r) {
// cerr << k << ' ' << l << ' ' << r << '\n';
vector<int> t;
for(int i = 1; i <= n * m; i++) har[i] = true;
for(int x = l; x <= r; x++) {
for(auto y: sure[x]) har[y] = false;
}
har[k] = false;
for(int i = 1; i <= n * m; i++) if(har[i]) t.pb(i);
return Query(t);
}
void Solve(int N, int M) {
n = N, m = M;
for(int i = 1; i <= n * m; i++) {
int l = 0, r = m - 1;
while(l < r) {
int mid = ((l + r) >> 1);
if(ask(i, l, mid) < m - (mid - l + 1)) l = mid + 1;
else r = mid;
}
sure[l].pb(i);
}
for(int i = 0; i < m; i++) Answer(sure[i]);
// return;
// sure[n - 1] = dk;
// vector<int> ans;
// for(int i = 0; i < m; i++) {
// ans.clear();
// for(int j = 0; j < n; j++) {
// ans.pb(sure[j][i]);
// }
// Answer(ans);
// }
return;
}
Compilation message (stderr)
dango3.cpp:14:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
14 | int variable_example = 1;
| ^~~~~~~~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |