# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
781074 | aZvezda | Super Dango Maker (JOI22_dango3) | C++17 | 153 ms | 596 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;
namespace {
int variable_example = 1;
} // namespace
const int MAX_N = 401;
vector<int> group[MAX_N];
void Solve(int n, int m) {
vector<int> lft = {};
for(int i = 1; i <= n * m; i ++) { lft.push_back(i); }
for(int i = 0; i < m; i ++) {
vector<int> group = {};
for(int j = 0; j < n; j ++) {
int l = 0, r = lft.size();
while(l < r - 1) {
int m = (l + r) / 2ll;
auto now = group;
for(int k = 0; k < m; k ++) {
now.push_back(lft[k]);
}
if(Query(now) >= 1) {
r = m;
} else {
l = m;
}
}
group.push_back(lft[l]);
swap(lft[lft.size() - 1], lft[l]);
lft.pop_back();
}
Answer(group);
}
}
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... |