結果
問題 |
No.1066 #いろいろな色 / Red and Blue and more various colors (Easy)
|
ユーザー |
![]() |
提出日時 | 2020-06-11 22:12:31 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 367 bytes |
コンパイル時間 | 211 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 359,064 KB |
最終ジャッジ日時 | 2024-06-24 03:23:44 |
合計ジャッジ時間 | 5,023 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 MLE * 11 |
ソースコード
import sys input=lambda: sys.stdin.readline().rstrip() n,q=map(int,input().split()) A=[int(i) for i in input().split()] B=[int(i) for i in input().split()] mod=998244353 DP=[[0]*(n+1) for i in range(n+1)] for i in range(n+1): DP[i][0]=1 for i,a in enumerate(A): for j in range(i+1): DP[i+1][j+1]=((a-1)*DP[i][j]+DP[i][j+1])%mod for b in B: print(DP[n][n-b])