# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1233481 | Tenis0206 | How to Avoid Disqualification in 75 Easy Steps (CEOI23_avoid) | C++20 | 1 ms | 428 KiB |
#include <bits/stdc++.h>
#include "avoid.h"
using namespace std;
pair<int,int> scout(int r, int h)
{
if(h == 1 && r == 10)
{
for(int b=0;b<10;b++)
{
vector<int> p;
for(int i=1;i<=1000;i++)
{
if((i & (1<<b)) == 0)
{
p.push_back(i);
}
}
send(p);
}
vector<int> r = wait();
int rez = 0;
for(int b=0;b<10;b++)
{
if(!r[b])
{
rez += (1<<b);
}
}
return {rez, rez};
}
if(r == 20 && h == 20)
{
int poz1 = 0, poz2 = 0;
int st = 1;
int dr = 1000;
while(st <= dr)
{
int mij = (st + dr) >> 1;
vector<int> p;
for(int i=1;i<=mij;i++)
{
p.push_back(i);
}
send(p);
vector<int> r = wait();
if(r.front() == 1)
{
poz1 = mij;
dr = mij - 1;
}
else
{
st = mij + 1;
}
}
st = poz1 + 1;
dr = 1000;
while(st <= dr)
{
int mij = (st + dr) >> 1;
vector<int> p;
for(int i=poz1+1;i<=mij;i++)
{
p.push_back(i);
}
send(p);
vector<int> r = wait();
if(r.front() == 1)
{
poz2 = mij;
dr = mij - 1;
}
else
{
st = mij + 1;
}
}
if(poz2 == 0)
{
poz2 = poz1;
}
return {poz1, poz2};
}
}
컴파일 시 표준 에러 (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... |