結果
| 問題 |
No.1066 #いろいろな色 / Red and Blue and more various colors (Easy)
|
| コンテスト | |
| ユーザー |
双六
|
| 提出日時 | 2020-08-11 04:58:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 573 bytes |
| コンパイル時間 | 215 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 359,296 KB |
| 最終ジャッジ日時 | 2024-10-09 11:08:55 |
| 合計ジャッジ時間 | 8,184 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 MLE * 11 |
ソースコード
# import sys; input = sys.stdin.buffer.readline # sys.setrecursionlimit(10**7) # from collections import defaultdict con = 998244353 def getlist(): return list(map(int, input().split())) #処理内容 def main(): N, Q = getlist() A = getlist() B = getlist() DP = [[0] * (N + 1) for i in range(N + 1)] DP[0][0] = 1 for i in range(N): for j in range(N): DP[i + 1][j] += (DP[i][j] * (A[i] - 1)) % con DP[i + 1][j + 1] += DP[i][j] DP[i + 1][j] %= con DP[i + 1][j + 1] %= con for i in range(Q): print(DP[-1][B[i]]) if __name__ == '__main__': main()
双六