結果

問題 No.1152 10億ゲーム
ユーザー vwxyzvwxyz
提出日時 2023-12-21 03:07:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 740 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 26,376 KB
平均クエリ数 11.62
最終ジャッジ日時 2023-12-21 03:07:50
合計ジャッジ時間 8,530 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
26,120 KB
testcase_01 AC 108 ms
26,120 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 107 ms
26,120 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 106 ms
26,120 KB
testcase_09 AC 107 ms
26,120 KB
testcase_10 AC 106 ms
26,120 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 108 ms
26,120 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 AC 108 ms
26,120 KB
testcase_49 AC 107 ms
26,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def x_to_cnt(x):
    cnt2,cnt5=0,0
    while x%2==0:
        x//=2
        cnt2+=1
    while x%5==0:
        x//=5
        cnt5+=1
    return cnt2,cnt5
def cnt_to_x(cnt2,cnt5):
    return 2**cnt2*5**cnt5
x1,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*=2
        c12+=1
    elif c12>7:
        x1//=2
        c12-=1
    elif c15<9:
        x1*=5
        c15+=1
    elif c15>9:
        x1//=5
        c15-=1
    print(x1)
    if x1==x2:
        exit()
    x2=int(input())
    if x1==x2:
        exit()
assert x1==2**7*5**9
if (abs(c12-c22)+abs(c15-c25))%2==0:
    x1=10**9
    print(x1)
    if x1==x2:
        exit()
    x2=int(input())
    if x1==x2:
        exit()
0