# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1040493 | byunjaewoo | How to Avoid Disqualification in 75 Easy Steps (CEOI23_avoid) | C++17 | 1 ms | 344 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "avoid.h"
#include <bits/stdc++.h>
using namespace std;
pair<int, int> scout(int R, int H) {
int a=0, b=0;
for(int i=0; i<10; i++) {
vector<int> T;
for(int j=1; j<=1000; j++) if(!(j&(1<<i))) T.push_back(j);
send(T);
}
for(int i=0; i<10; i++) {
vector<int> T;
for(int j=1; j<=1000; j++) if(j&(1<<i)) T.push_back(j);
send(T);
}
vector<int> T=wait();
vector<int> V;
int X[10][2]={0};
for(int i=0; i<10; i++) {
if(T[i]) X[i][0]=1;
if(T[10+i]) X[i][1]=1;
if(X[i][0] && X[i][1]) V.push_back(i);
if(!X[i][0]) a|=(1<<i), b|=(1<<i);
}
if(V.empty()) return {a, b};
for(int i=0; i<V.size()-1; i++) {
vector<int> t;
for(int j=1; j<=1000; j++) if((!(j&(1<<V[i]))) && (j&(1<<V[i+1]))) t.push_back(j);
send(t);
}
vector<int> T2=wait();
b|=(1<<V[0]);
for(int i=0; i<V.size()-1; i++) {
if(a&(1<<V[i])) {
if(!T2[i]) a|=(1<<V[i+1]);
else b|=(1<<V[i+1]);
}
else {
if(T2[i]) a|=(1<<V[i+1]);
else b|=(1<<V[i+1]);
}
}
return {a, b};
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |