結果

問題 No.1047 Zero (Novice)
ユーザー mlihua09mlihua09
提出日時 2020-08-29 15:11:37
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 266 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 64,740 KB
最終ジャッジ日時 2024-04-26 21:44:24
合計ジャッジ時間 4,357 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
59,708 KB
testcase_01 AC 40 ms
52,556 KB
testcase_02 AC 39 ms
53,256 KB
testcase_03 AC 39 ms
53,348 KB
testcase_04 AC 39 ms
52,460 KB
testcase_05 AC 38 ms
53,184 KB
testcase_06 AC 38 ms
52,080 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #


A, B = map(int, input().split())

x = B

i = 1

if A == 0 and B != 0:
    
    print(-1)
    exit()

while x != 0:
    
    if x % A == 0:
        
        x //= A
        x += B
        
    else:
        
        print(-1)
        exit()
    i += 1
    
print(i)
0