結果
| 問題 | No.1066 #いろいろな色 / Red and Blue and more various colors (Easy) |
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2024-09-19 23:44:46 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 217 ms / 2,000 ms |
| + 372µs | |
| コード長 | 297 bytes |
| 記録 | |
| コンパイル時間 | 220 ms |
| コンパイル使用メモリ | 96,460 KB |
| 実行使用メモリ | 85,096 KB |
| 最終ジャッジ日時 | 2026-08-31 10:44:58 |
| 合計ジャッジ時間 | 4,708 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
n,q=map(int,input().split())
M=998244353
a=list(map(int,input().split()))
q=[0]*(n+1)
q[0]=1
for v in a:
nq=[0]*(n+1)
for i in range(n+1):
nq[i]+=q[i]*(v-1)
nq[i]%=M
if i+1<=n:
nq[i+1]+=q[i]*1
nq[i+1]%=M
q=nq
b=list(map(int,input().split()))
for v in b:
print(q[v])
sasa8uyauya