結果
| 問題 | No.1152 10億ゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-12 06:59:30 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 98 ms / 2,000 ms |
| コード長 | 905 bytes |
| 記録 | |
| コンパイル時間 | 143 ms |
| コンパイル使用メモリ | 85,668 KB |
| 実行使用メモリ | 72,600 KB |
| 平均クエリ数 | 26.00 |
| 最終ジャッジ日時 | 2026-05-12 06:59:39 |
| 合計ジャッジ時間 | 7,357 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 50 |
ソースコード
A, B = (int(x) for x in input().split())
def wait():
print(A)
if A == B:
exit()
b = int(input())
if A == b:
exit()
return b
def parse(X):
i = 0
j = 0
while X % 2 == 0:
i += 1
X //= 2
while X % 5 == 0:
j += 1
X //= 5
return i, j
ai, aj = parse(A)
while ai < 7:
ai += 1
A *= 2
B = wait()
while ai > 7:
ai -= 1
A //= 2
B = wait()
while aj < 9:
aj += 1
A *= 5
B = wait()
bi, bj = parse(B)
if (ai + aj + bi + bj) % 2 == 0:
ai = 9
A *= 4
B = wait()
else:
for _ in range(2):
ai += 1
A *= 2
B = wait()
bi, bj = parse(B)
while True:
while ai - bi > aj - bj:
ai -= 1
A //= 2
B = wait()
bi, bj = parse(B)
while ai - bi < aj - bj:
aj -= 1
A //= 5
B = wait()
bi, bj = parse(B)