結果
問題 |
No.513 宝探し2
|
ユーザー |
![]() |
提出日時 | 2020-11-25 07:29:13 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 518 bytes |
コンパイル時間 | 219 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 27,864 KB |
平均クエリ数 | 49.50 |
最終ジャッジ日時 | 2024-07-17 07:33:10 |
合計ジャッジ時間 | 3,321 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 7 |
ソースコード
cache = {} def query(x, y): if (x, y) in cache: return cache[x, y] print(x, y) result = int(input()) cache[x, y] = result if result == 0: exit() return result l = 0 r = 100000 while r - l >= 3: c1 = (l * 2 + r) // 3 c2 = (l + r * 2) // 3 if query(c1, 0) > query(c2, 0): l = c1 else: r = c2 m = query(l, 0) i = l for j in range(l + 1, r + 1): if query(j, 0) >= m: continue m = query(j, 0) AX = m AY = query(AX, 0) query(AX, AY)