結果
問題 | No.513 宝探し2 |
ユーザー | rlangevin |
提出日時 | 2023-01-26 01:03:57 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 70 ms / 2,000 ms |
コード長 | 1,741 bytes |
コンパイル時間 | 468 ms |
コンパイル使用メモリ | 81,292 KB |
実行使用メモリ | 71,304 KB |
平均クエリ数 | 43.92 |
最終ジャッジ日時 | 2024-07-17 03:15:01 |
合計ジャッジ時間 | 2,368 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 70 ms
69,516 KB |
testcase_01 | AC | 70 ms
70,252 KB |
testcase_02 | AC | 67 ms
69,436 KB |
testcase_03 | AC | 67 ms
69,776 KB |
testcase_04 | AC | 68 ms
70,644 KB |
testcase_05 | AC | 63 ms
68,320 KB |
testcase_06 | AC | 67 ms
71,304 KB |
testcase_07 | AC | 68 ms
70,084 KB |
testcase_08 | AC | 65 ms
70,820 KB |
testcase_09 | AC | 63 ms
69,872 KB |
testcase_10 | AC | 64 ms
69,048 KB |
testcase_11 | AC | 65 ms
69,060 KB |
ソースコード
M = 10 ** 5 print(0, 0, flush=True) a = int(input()) if a == 0: exit() print(1, 0, flush=True) b = int(input()) if b == 0: exit() print(M - 1, 0, flush=True) c = int(input()) if c == 0: exit() print(M, 0, flush=True) d = int(input()) if d == 0: exit() if a < b: left = right = 0 elif c > d: left = right = M else: left = 0 right = M - 1 while right - left != 1: mid = (left + right)//2 print(mid, 0, flush=True) n1 = int(input()) if n1 == 0: exit() print(mid + 1, 0, flush=True) n2 = int(input()) if n2 == 0: exit() if n1 > n2: left = mid else: right = mid print(0, 0, flush=True) a = int(input()) if a == 0: exit() print(0, 1, flush=True) b = int(input()) if b == 0: exit() print(0, M - 1, flush=True) c = int(input()) if c == 0: exit() print(0, M, flush=True) d = int(input()) if d == 0: exit() if a < b: up = down = 0 elif c > d: up = down = M else: down = 0 up = M - 1 while up - down != 1: mid = (down + up)//2 print(0, mid, flush=True) n1 = int(input()) if n1 == 0: exit() print(0, mid + 1, flush=True) n2 = int(input()) if n2 == 0: exit() if n1 > n2: down = mid else: up = mid print(left, up, flush=True) d = int(input()) if d == 0: exit() print(left, down, flush=True) d = int(input()) if d == 0: exit() print(right, up, flush=True) d = int(input()) if d == 0: exit() print(right, down, flush=True) d = int(input()) if d == 0: exit()