# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
951594 | pcc | Super Dango Maker (JOI22_dango3) | C++17 | 361 ms | 2936 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>
#include <vector>
using namespace std;
namespace {
int variable_example = 1;
const int mxn = 1e5+10;
int col[mxn];
vector<int> done[mxn];
} // namespace
/*
std::vector<int> x(3);
x[0] = 1;
x[1] = 2;
x[2] = 3;
variable_example = Query(x);
for (int i = 0; i < M; i++) {
std::vector<int> a(N);
for (int j = 0; j < N; j++) {
a[j] = N * i + j + 1;
}
Answer(a);
}
*/
void Solve(int N, int M) {
for(int i = 1;i<=N;i++){
vector<int> v = {};
for(int j = 1;j<i;j++){
v.push_back(done[j][0]);
}
for(int j = 1;j<=N*M;j++){
if(col[j])continue;
v.push_back(j);
if(v.size()<N)continue;
if(Query(v) == 1){
col[j] = i;
done[i].push_back(j);
v.pop_back();
}
}
}
for(int i = 0;i<M;i++){
vector<int> v;
for(int j = 1;j<=N;j++)v.push_back(done[j][i]);
Answer(v);
}
return;
}
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... |