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>
using namespace std;
#define rall(s) s.rbegin() s.rend()
#define all(s) s.begin(), s.end()
#define sz(s) (int)s.size()
#define s second
#define f first
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
mt19937_64 rng(1733107);
void Solve(int n, int m) {
vector<int> s;
for (int i = 1; i <= n * m; i++) s.push_back(i);
shuffle(all(s), rng);
for (int i = 1; i < m; i++) {
vector<int> ans = {s.back()};
s.pop_back();
while (sz(ans) < n) {
int x = s.back();
s.pop_back();
if (Query(s) == m - i) ans.push_back(x);
else {
reverse(all(s));
s.push_back(x);
reverse(all(s));
}
}
Answer(ans);
}
Answer(s);
}
# | 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... |