結果
問題 | No.1152 10億ゲーム |
ユーザー |
![]() |
提出日時 | 2023-12-21 03:07:21 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 595 bytes |
コンパイル時間 | 237 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 27,880 KB |
平均クエリ数 | 11.34 |
最終ジャッジ日時 | 2024-09-27 10:42:21 |
合計ジャッジ時間 | 9,099 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 WA * 41 |
ソースコード
def x_to_cnt(x):cnt2,cnt5=0,0while x%2==0:x//=2cnt2+=1while x%5==0:x//=5cnt5+=1return cnt2,cnt5def cnt_to_x(cnt2,cnt5):return 2**cnt2*5**cnt5x1,x2=map(int,input().split())c12,c15=x_to_cnt(x1)c22,c25=x_to_cnt(x2)while (c12,c15)!=(7,9):if c12<7:x1*=2c12+=1elif c12>7:x1//=2c12-=1elif c15<9:x1*=5c15+=1elif c15>9:x1//=5c15-=1print(x1)if x1==x2:exit()x2=int(input())if x1==x2:exit()assert x1==2**7*5**9