# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
288219 | Kastanda | Aliens (IOI07_aliens) | C++11 | 2 ms | 256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// M
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, m, nwx, nwy;
int main()
{
scanf("%lld%lld%lld", &n, &nwx, &nwy);
auto Query = [&](ll a, ll b){
if (a < 1 || a > n || b < 1 || b > n)
return false;
printf("examine %lld %lld\n", a, b);
fflush(stdout);
char ss[7];
scanf("%s", ss);
return (bool)(ss[0] == 't');
};
{
ll lg = 0;
while (Query(nwx - (1LL << lg), nwy))
lg ++;
ll left_gap = 0;
for (int i = lg - 1; i >= 0; i --)
if (Query(nwx - left_gap - (1LL << i), nwy))
left_gap |= 1LL << i;
lg = 0;
while (Query(nwx + (1LL << lg), nwy))
lg ++;
ll right_gap = 0;
for (int i = lg - 1; i >= 0; i --)
if (Query(nwx + right_gap + (1LL << i), nwy))
right_gap |= 1LL << i;
m = right_gap + left_gap + 1;
nwx -= left_gap;
lg = 0;
while (Query(nwx, nwy - (1LL << lg)))
lg ++;
ll up_gap = 0;
for (int i = lg - 1; i >= 0; i --)
if (Query(nwx, nwy - up_gap - (1LL << i)))
up_gap |= 1LL << i;
nwy -= up_gap;
ll cx = 0, cy = 0;
while (Query(nwx - m * (cx + 2), nwy))
cx += 2;
if (Query(nwx - m * cx - m, nwy - m))
cx ++, cy ++;
while (Query(nwx, nwy - m * (cy + 2)))
cy += 2;
nwx -= m * cx;
nwy -= m * cy;
nwx += m * 2 + m / 2;
nwy += m * 2 + m / 2;
printf("solution %lld %lld\n", nwx, nwy);
}
}
컴파일 시 표준 에러 (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... |
# | 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... |