結果

問題 No.1066 #いろいろな色 / Red and Blue and more various colors (Easy)
ユーザー Kiri8128Kiri8128
提出日時 2020-05-30 00:30:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 844,228 KB
最終ジャッジ日時 2023-08-06 06:55:52
合計ジャッジ時間 4,362 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,156 KB
testcase_01 AC 71 ms
71,272 KB
testcase_02 AC 70 ms
71,212 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