# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
942529 | makrav | Super Dango Maker (JOI22_dango3) | C++17 | 1159 ms | 992 KiB |
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 all(x) (x).begin(), (x).end()
vector<int> sol(int n, int m, vector<int> nums) {
random_shuffle(all(nums));
vector<int> used(n * m, 0), ans;
for (int i = 0; i < n * m; i++) {
if (ans.size() == n) return ans;
vector<int> lol;
used[i] = 1;
for (int j = 0; j < n * m; j++) {
if (!used[j]) lol.push_back(nums[j]);
}
int A = Query(lol);
if (A != m - 1) {
used[i] = 0;
continue;
}
ans.push_back(nums[i]);
}
return ans;
}
void Solve(int N, int M) {
vector<int> used(N * M, 0);
for (int j = 0; j < M; j++) {
vector<int> curost;
for (int i = 0; i < N * M; i++) {
if (!used[i]) curost.push_back(i + 1);
}
vector<int> answ = sol(N, M - j, curost);
Answer(answ);
for (int j = 0; j < answ.size(); j++) used[answ[j] - 1] = 1;
}
}
Compilation message (stderr)
# | 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... |