結果

問題 No.1047 Zero (Novice)
ユーザー magmag
提出日時 2020-07-02 08:17:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 140 bytes
コンパイル時間 713 ms
コンパイル使用メモリ 10,640 KB
実行使用メモリ 8,344 KB
最終ジャッジ日時 2023-10-12 21:39:38
合計ジャッジ時間 3,484 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,080 KB
testcase_01 AC 30 ms
7,844 KB
testcase_02 AC 15 ms
8,024 KB
testcase_03 AC 118 ms
8,308 KB
testcase_04 AC 130 ms
8,312 KB
testcase_05 AC 118 ms
8,344 KB
testcase_06 AC 15 ms
8,028 KB
testcase_07 AC 17 ms
7,824 KB
testcase_08 AC 15 ms
8,212 KB
testcase_09 AC 15 ms
8,036 KB
testcase_10 AC 17 ms
7,888 KB
testcase_11 AC 17 ms
7,932 KB
testcase_12 AC 17 ms
7,744 KB
testcase_13 AC 125 ms
8,300 KB
testcase_14 AC 96 ms
8,232 KB
testcase_15 AC 116 ms
8,308 KB
testcase_16 AC 128 ms
8,208 KB
testcase_17 AC 116 ms
8,340 KB
testcase_18 AC 15 ms
8,072 KB
testcase_19 AC 115 ms
8,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

N = 0
for i in range(1, 10000):
    N = A * N + B
    if N == 0:
        print(i)
        exit()
print(-1)
0