結果

問題 No.1047 Zero (Novice)
ユーザー ShirotsumeShirotsume
提出日時 2021-10-25 02:00:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 141 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 57,752 KB
最終ジャッジ日時 2024-04-10 07:23:36
合計ジャッジ時間 1,871 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,068 KB
testcase_01 AC 36 ms
53,284 KB
testcase_02 AC 35 ms
51,980 KB
testcase_03 AC 38 ms
57,100 KB
testcase_04 AC 39 ms
57,312 KB
testcase_05 AC 38 ms
56,480 KB
testcase_06 AC 37 ms
52,624 KB
testcase_07 AC 37 ms
52,208 KB
testcase_08 AC 40 ms
52,136 KB
testcase_09 AC 35 ms
53,488 KB
testcase_10 AC 38 ms
52,916 KB
testcase_11 AC 36 ms
53,032 KB
testcase_12 AC 36 ms
52,556 KB
testcase_13 AC 39 ms
56,540 KB
testcase_14 AC 38 ms
57,104 KB
testcase_15 AC 38 ms
56,232 KB
testcase_16 AC 38 ms
56,116 KB
testcase_17 AC 40 ms
57,752 KB
testcase_18 AC 36 ms
52,840 KB
testcase_19 AC 38 ms
57,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(int,input().split())
n = 0
for i in range(10 ** 3):
    n = a * n + b
    if n == 0:
        print(i + 1)
        exit()
print(-1)
0