結果

問題 No.1066 #いろいろな色 / Red and Blue and more various colors (Easy)
ユーザー Kiri8128Kiri8128
提出日時 2020-05-30 00:30:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 848,468 KB
最終ジャッジ日時 2024-04-24 03:07:16
合計ジャッジ時間 3,446 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,012 KB
testcase_01 AC 36 ms
52,924 KB
testcase_02 AC 36 ms
53,416 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 MLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, Q = map(int, input().split())
A = [int(a) - 1 for a in input().split()]
X = [[0] * (i+1) for i in range(N+1)]
X[0][0] = 1
for 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]

B = [int(a) for a in input().split()]
for a in B:
    print(X[-1][a])
0