結果
| 問題 |
No.1047 Zero (Novice)
|
| コンテスト | |
| ユーザー |
amyu
|
| 提出日時 | 2020-05-08 21:30:37 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 246 bytes |
| コンパイル時間 | 110 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 18,624 KB |
| 最終ジャッジ日時 | 2024-07-03 23:54:21 |
| 合計ジャッジ時間 | 4,623 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 16 |
ソースコード
a,b=map(int,input().split())
n=0
if b==0:
print(1)
elif a==1:
if n%b==0 and n//b>0:
print(n//b)
else:
for i in range(10**5):
n=a*n+b
if n==0:
print(i+1)
break
else:
print(-1)
amyu