結果

問題 No.2962 Sum Bomb Bomber
ユーザー hiro1729
提出日時 2024-11-17 17:35:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 754 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 76,384 KB
平均クエリ数 234.00
最終ジャッジ日時 2024-11-17 17:35:46
合計ジャッジ時間 11,180 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 64
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
lx, rx = -10 ** 9, 10 ** 9
while lx + 2 < rx:
	m1 = lx + (rx - lx) // 3
	m2 = rx - (rx - lx) // 3
	print(1, m1, 0, flush = True)
	c1 = int(input())
	print(1, m2, 0, flush = True)
	c2 = int(input())
	if c1 < c2:
		rx = m2
	else:
		lx = m1
ly, ry = -10 ** 9, 10 ** 9
while ly + 2 < ry:
	m1 = ly + (ry - ly) // 3
	m2 = ry - (ry - ly) // 3
	print(1, 0, m1, flush = True)
	c1 = int(input())
	print(1, 0, m2, flush = True)
	c2 = int(input())
	if c1 < c2:
		ry = m2
	else:
		ly = m1
ax, ay = 0, 0
m = 10 ** 18
for i in range(lx - 2, lx + 3):
	for j in range(ly - 2, ly + 3):
		if abs(i) <= 10 ** 9 and abs(j) <= 10 ** 9:
			print(1, i, j, flush = True)
			c = int(input())
			if c < m:
				m = c
				ax, ay = i, j
print(2, ax, ay, flush = True)
0