結果
| 問題 | No.3716 Keep it Integer |
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2026-09-18 22:48:40 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 742 ms / 2,000 ms |
| + 507µs | |
| コード長 | 408 bytes |
| 記録 | |
| コンパイル時間 | 76 ms |
| コンパイル使用メモリ | 80,896 KB |
| 実行使用メモリ | 120,064 KB |
| 最終ジャッジ日時 | 2026-09-18 22:48:52 |
| 合計ジャッジ時間 | 9,975 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 50 |
ソースコード
N,X=map(int,input().split())
A=list(map(int,input().split()))
d = [(X,1)]
cnt = 1
for i in range(N):
if A[i] == 1:
d.append((A[i],cnt))
cnt*=2
cnt %= 998244353
continue
#print(cnt)
d_ = [(A[i], cnt)]
for a,c in d:
if a%A[i] == 0:
cnt += c
d_.append((a//A[i],c))
d = d_
cnt = 0
for _,c in d:
cnt += c
print(cnt%998244353)
nikoro256