# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
951616 | LittleOrange | Super Dango Maker (JOI22_dango3) | C++17 | 251 ms | 724 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dango3.h"
#include <vector>
#include<bits/stdc++.h>
namespace {
int variable_example = 1;
using namespace std;
using ll = int;
} // namespace
void Solve(int N, int M) {
ll nm = N*M;
ll n = N;
vector<ll> a(nm,1);
mt19937_64 mt(random_device{}());
for(ll round = 0;round<M;round++){
vector<ll> b;
for(ll i = 0;i<nm;i++) if(a[i])b.push_back(i+1);
shuffle(b.begin(),b.end(),mt);
if (round==M-1){
Answer(b);
return;
}
ll l = n,r=b.size();
while(l<r){
ll m = l+r>>1;
vector<ll> c;
for(ll i = 0;i<m;i++) c.push_back(b[i]);
if(Query(c)>=1){
r = m;
}else{
l = m+1;
}
}
vector<ll> choose(l,1);
ll chcnt = l;
for(ll i = 0;i<l&&chcnt>n;i++){
choose[i] = 0;
vector<ll> c;
for(ll i = 0;i<l;i++) if(choose[i])c.push_back(b[i]);
if(Query(c)==0){
choose[i] = 1;
}else{
chcnt--;
}
}
vector<ll> out;
for(ll i = 0;i<l;i++) if(choose[i]){
out.push_back(b[i]);
a[b[i]-1] = 0;
}
Answer(out);
}
}
컴파일 시 표준 에러 (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... |