# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1020702 | Unforgettablepl | Super Dango Maker (JOI22_dango3) | C++17 | 400 ms | 608 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 SQRT = 5;
} // namespace
void Solve(int N, int M) {
vector<int> idxes(N*M);iota(idxes.begin(),idxes.end(),1);
// shuffle(idxes.begin(),idxes.end(),mt19937(random_device()()));
idxes.insert(idxes.begin(),0);
for(int round=0;round<M-1;round++){
vector<int> ans;
if(0<=round and round<=5)SQRT=5;
else if(6<=round and round<=13)SQRT=4;
else if(14<=round and round<=19)SQRT=3;
else if(20<=round and round<=23)SQRT=2;
for(int included=N*(M-round);included;included-=SQRT){
vector<int> query;
for(int i=1;i<=(included-SQRT);i++)query.emplace_back(idxes[i]);
int q = 0;
if(!query.empty()){
for(int&i:ans)query.emplace_back(i);
q = Query(query);
}
if(q>=1)continue;
for(int inc=included;inc>included-SQRT;inc--){
vector<int> query;
for(int i=1;i<inc;i++)query.emplace_back(idxes[i]);
int q = 0;
if(!query.empty()){
for(int&i:ans)query.emplace_back(i);
q = Query(query);
}
if(q>=1)continue;
ans.emplace_back(idxes[inc]);
idxes.erase(idxes.begin()+inc);
if(ans.size()==N)break;
}
if(ans.size()==N)break;
}
Answer(ans);
}
idxes.erase(idxes.begin());
Answer(idxes);
}
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... |