# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
737791 | Deepesson | Super Dango Maker (JOI22_dango3) | C++17 | 621 ms | 532 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
///#include "dango3.h"
void Answer(const std::vector<int> &a);
int Query(const std::vector<int> &x);
std::vector<int> concatena(std::vector<int> a,std::vector<int> b){
for(auto&x:b)a.push_back(x);
return a;
}
void Solve(int N, int M) {
int tot = N*M;
std::vector<int> consulta;
for(int i=0;i!=tot;++i)consulta.push_back(i+1);
std::random_shuffle(consulta.begin(),consulta.end());
int tem=tot;
bool foi[tot]={};
for(int i=0;i!=M;++i){
std::vector<int> base;
int limtemp=1e9;
int limbase=N;
while(base.size()!=N){
int l=N-base.size(),r=std::min({5000,limtemp,tem});
while(l<r){
int m = (l+r)/2;
std::vector<int> add;
for(int j=0,cur=0;j<m;++cur){
if(!foi[cur]){add.push_back(consulta[cur]);++j;}
}
if(Query(concatena(add,base))>=1){
r=m;
limtemp=r;
}else {l=m+1;limbase=m;}
}
int puxa=-1;
for(int j=0,cur=0;j<l;++cur){
if(!foi[cur]){++j;puxa=cur;}
}
base.push_back(consulta[puxa]);
foi[puxa]=1;
--tem;
--limbase;
}
Answer(base);
}
}
컴파일 시 표준 에러 (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... |