結果

問題 No.1066 #いろいろな色 / Red and Blue and more various colors (Easy)
ユーザー c-yanc-yan
提出日時 2020-05-31 20:28:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 319 ms / 2,000 ms
コード長 194 bytes
コンパイル時間 599 ms
コンパイル使用メモリ 87,016 KB
実行使用メモリ 76,864 KB
最終ジャッジ日時 2023-08-11 18:34:51
合計ジャッジ時間 6,418 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,348 KB
testcase_01 AC 75 ms
71,268 KB
testcase_02 AC 75 ms
71,300 KB
testcase_03 AC 74 ms
71,164 KB
testcase_04 AC 75 ms
71,356 KB
testcase_05 AC 75 ms
71,300 KB
testcase_06 AC 76 ms
71,172 KB
testcase_07 AC 73 ms
71,116 KB
testcase_08 AC 185 ms
76,864 KB
testcase_09 AC 79 ms
75,612 KB
testcase_10 AC 319 ms
76,508 KB
testcase_11 AC 141 ms
76,424 KB
testcase_12 AC 129 ms
76,808 KB
testcase_13 AC 140 ms
76,776 KB
testcase_14 AC 146 ms
76,672 KB
testcase_15 AC 241 ms
76,744 KB
testcase_16 AC 113 ms
76,748 KB
testcase_17 AC 117 ms
76,676 KB
testcase_18 AC 228 ms
76,724 KB
testcase_19 AC 138 ms
76,740 KB
testcase_20 AC 80 ms
75,732 KB
testcase_21 AC 195 ms
76,860 KB
testcase_22 AC 80 ms
76,540 KB
testcase_23 AC 74 ms
71,240 KB
testcase_24 AC 73 ms
71,168 KB
testcase_25 AC 298 ms
76,720 KB
testcase_26 AC 269 ms
76,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,_=map(int,input().split())
t=[0]*(N+2)
t[0]=1
for a in map(int,input().split()):
 for i in range(N,-1,-1):
  t[i]=(t[i]*(a-1)+t[i-1])%998244353
for b in map(int,input().split()):
 print(t[b])
0