| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 640074 | victor_gao | Super Dango Maker (JOI22_dango3) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "dango3.h"
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void Solve(int n,int m){
int B[30]={0,1,1,1,1,1,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,5,5};
deque<int>all;
for (int i=1;i<=n*m;i++)
all.push_back(i);
for (int i=1;i<=m;i++){
bool find=1;
while (find){
shuffle(all.begin(),all.end(),rng);
deque<int>now;
ok.clear();
int sz=all.size();
for (int j=0;j<sz/B[i];j++){
now.push_front(all[sz-j-1]);
}
int Q=Query(now);
if (Q==0) continue;
else {
int nsz=now.size();
for (int i=0;i<nsz;i++){
int out=now.back();
now.pop_back();
all.pop_back();
int nq=Query(now);
if (nq==0){
now.push_front(out);
}
else all.push_front(out);
}
find=0;
Answer(now);
}
}
}
}
