結果

問題 No.1047 Zero (Novice)
ユーザー ntuda
提出日時 2025-02-08 18:46:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 177 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 81,932 KB
実行使用メモリ 53,884 KB
最終ジャッジ日時 2025-02-08 18:46:08
合計ジャッジ時間 1,922 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 14 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B = map(int,input().split())
if A > 0 and B > 0:
    print(-1)
N = 0
for i in range(10):
    N = A * N + B
    if N == 0:
        print(i+1)
        exit()
else:
    print(-1)
0