# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
589727 | Tekor | Super Dango Maker (JOI22_dango3) | C++17 | 408 ms | 436 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dango3.h"
#include <vector>
namespace {
int variable_example = 1;
} // namespace
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
const int K = 1e4 + 10;
bool ban[K];
vector <int> dob;
int check(int l,int r,int n) {
vector <int> zap;
for(int i = l;i <= r;i++) {
if(ban[i])continue;
zap.pb(i);
}
for(auto to : dob)zap.pb(to);
if(zap.size() < n)return 0;
// cout <<"? ";
// for(auto to : zap) {
// cout << to << " ";
// }
// cout << " from ";
// for(auto to : dob) {
// cout << to << " ";
// }
// cout << endl;
return Query(zap);
}
/*
3 2
3 3 1 2 1 2
*/
void Solve(int n,int m) {
for(int i = 1;i <= n * m;i++)ban[i] = 0;
queue <int> q;
for(int it = 1;it <= m;it++) {
int fir = -1;
if(!q.empty()) {
fir = q.front();
q.pop();
}else {
for(int l = 1;l <= n * m;l++) {
if(!ban[l]) {
fir = l;
break;
}
}
}
dob.clear();
dob.pb(fir);
ban[fir] = 1;
int last = fir;
for(int i = 2;i <= n;i++) {
int l = last + 2,r = n * m,ans = n * m + 1;
while(l <= r) {
int mid = (l + r) / 2;
int dd = check(mid,n * m,n);
if(dd > 1 && !ban[mid]) {
q.push(mid);
}
if(dd == 0) {
ans = mid;
r = mid - 1;
}else {
l = mid + 1;
}
}
dob.pb(ans - 1);
ban[ans - 1] = 1;
last = ans - 1;
}
Answer(dob);
}
}
컴파일 시 표준 에러 (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... |