# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1029607 | Otalp | Super Dango Maker (JOI22_dango3) | C++17 | 4180 ms | 1004 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 pb push_back
namespace {
int variable_example = 1;
} // namespace
void Solve(int N, int M) {
int n = N, m = M;
map<int, int> us;
vector<int> rs;
for(int i=1; i<=n*m; i++){
rs.pb(i);
}
random_shuffle(rs.begin(), rs.end());
for(int i=1; i<=m; i++){
vector<int> d;
for(int j: rs){
if(us[j]) continue;
d.pb(j);
if(d.size() >= n){
int g = Query(d);
if(g) break;
}
}
map<int, int> dus;
for(int x: d){
vector<int> f;
for(int y: d){
if(x == y) continue;
if(dus[y]) continue;
f.pb(y);
}
int g = Query(f);
if(g == 1){
dus[x] = 1;
}
else{
us[x] = 1;
}
}
vector<int> f;
for(int x: d){
if(us[x]) f.pb(x);
}
Answer(f);
}
}
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... |