結果
問題 | No.1066 #いろいろな色 / Red and Blue and more various colors (Easy) |
ユーザー |
![]() |
提出日時 | 2020-05-30 00:31:24 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 368 bytes |
コンパイル時間 | 470 ms |
コンパイル使用メモリ | 82,260 KB |
実行使用メモリ | 206,128 KB |
最終ジャッジ日時 | 2024-11-06 09:56:38 |
合計ジャッジ時間 | 5,120 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 MLE * 6 |
ソースコード
N, Q = map(int, input().split())P = 998244353A = [int(a) - 1 for a in input().split()]X = [[0] * (i+1) for i in range(N+1)]X[0][0] = 1for i in range(N):for j in range(i+1):X[i+1][j] += X[i][j] * A[i]X[i+1][j+1] += X[i][j]X[i+1][j] %= PX[i+1][j+1] %= PB = [int(a) for a in input().split()]for a in B:print(X[-1][a])