結果

問題 No.513 宝探し2
ユーザー tonnnura172
提出日時 2020-04-19 10:40:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 1,427 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 40,920 KB
平均クエリ数 1.00
最終ジャッジ日時 2024-07-17 03:27:10
合計ジャッジ時間 3,361 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul, add
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce, lru_cache
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

print(0, 0)
dl = INT()
if dl == 0:
	exit()
sys.stdout.flush()
print(100000, 0)
dr = INT()
if dr == 0:
	exit()
sys.stdout.flush()

l = 0
r = 100000
while l+1 != r:
	m = (l+r)//2
	print(m, 0)
	dm = INT()
	if dm == 0:
		exit()
	sys.stdout.flush()
	if abs(dm-dl) < abs(dm-dr):
		r = m
		dr = dm
	else:
		l = m
		dl = dm

x = l
print(x, 0)
dl = INT()
if dl == 0:
	exit()
sys.stdout.flush()
print(x, 100000)
dr = INT()
if dr == 0:
	exit()
sys.stdout.flush()
l = 0
r = 100000
while l+1 != r:
	m = (l+r)//2
	print(x, m)
	dm = INT()
	if dm == 0:
		exit()
	sys.stdout.flush()
	if abs(dm-dl) < abs(dm-dr):
		r = m
		dr = dm
	else:
		l = m
		dl = dm

y = l
print(x, y)
0