結果

問題 No.1066 #いろいろな色 / Red and Blue and more various colors (Easy)
ユーザー convexineqconvexineq
提出日時 2020-05-29 21:47:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 858 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 45,548 KB
最終ジャッジ日時 2024-04-23 21:13:01
合計ジャッジ時間 17,314 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 439 ms
43,552 KB
testcase_01 AC 445 ms
43,676 KB
testcase_02 AC 437 ms
43,556 KB
testcase_03 AC 440 ms
44,456 KB
testcase_04 AC 457 ms
43,688 KB
testcase_05 AC 443 ms
44,324 KB
testcase_06 AC 442 ms
43,812 KB
testcase_07 AC 441 ms
43,556 KB
testcase_08 AC 635 ms
44,728 KB
testcase_09 AC 443 ms
44,320 KB
testcase_10 AC 841 ms
44,884 KB
testcase_11 AC 574 ms
44,532 KB
testcase_12 AC 546 ms
43,756 KB
testcase_13 AC 573 ms
44,520 KB
testcase_14 AC 582 ms
44,844 KB
testcase_15 AC 727 ms
45,100 KB
testcase_16 AC 510 ms
43,828 KB
testcase_17 AC 522 ms
44,488 KB
testcase_18 AC 714 ms
45,056 KB
testcase_19 AC 564 ms
43,928 KB
testcase_20 AC 448 ms
44,320 KB
testcase_21 AC 669 ms
44,636 KB
testcase_22 AC 452 ms
44,312 KB
testcase_23 AC 447 ms
43,812 KB
testcase_24 AC 445 ms
43,668 KB
testcase_25 AC 848 ms
45,548 KB
testcase_26 AC 858 ms
44,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read

n,q = map(int,readline().split())
*a, = map(int,readline().split())
*b, = map(int,readline().split())


import numpy as np

MOD = 998244353
x = np.array([1],dtype=np.int64)

for i in range(n):
    x = (a[i]-1)*(np.insert(x,i+1,0)) + np.insert(x,0,0)
    x %= MOD

for i in b:
    print(x[i])
0