結果

問題 No.1066 #いろいろな色 / Red and Blue and more various colors (Easy)
ユーザー c-yan
提出日時 2020-05-29 22:14:16
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 356 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 83,212 KB
最終ジャッジ日時 2024-11-06 05:11:59
合計ジャッジ時間 4,145 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 TLE * 1 -- * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations

N, Q = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

for b in B:
    result = 0
    for c in combinations(A, N - b):
        t = 1
        for i in c:
            t *= i - 1
            t %= 998244353
        result += t
        result %= 998244353
    print(result)
0