結果

問題 No.1047 Zero (Novice)
ユーザー neterukunneterukun
提出日時 2020-05-08 21:27:51
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 178 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 71,464 KB
最終ジャッジ日時 2023-09-17 01:35:13
合計ジャッジ時間 2,434 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,096 KB
testcase_01 AC 63 ms
71,332 KB
testcase_02 AC 60 ms
71,424 KB
testcase_03 AC 64 ms
71,096 KB
testcase_04 AC 68 ms
71,252 KB
testcase_05 AC 66 ms
71,256 KB
testcase_06 AC 64 ms
71,208 KB
testcase_07 AC 66 ms
71,236 KB
testcase_08 AC 61 ms
71,372 KB
testcase_09 AC 63 ms
71,420 KB
testcase_10 AC 65 ms
71,400 KB
testcase_11 AC 65 ms
71,200 KB
testcase_12 AC 66 ms
71,092 KB
testcase_13 AC 66 ms
71,268 KB
testcase_14 AC 68 ms
71,216 KB
testcase_15 AC 69 ms
71,252 KB
testcase_16 AC 67 ms
71,336 KB
testcase_17 AC 69 ms
71,180 KB
testcase_18 AC 70 ms
71,464 KB
testcase_19 AC 68 ms
71,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(int, input().split())

n = 0
cnt = 0
while cnt <= 1000:
    cnt += 1
    new_n = a * n + b
    if new_n == 0:
        print(cnt)
        exit()
    n = new_n
print(-1)
0