結果
問題 | No.1068 #いろいろな色 / Red and Blue and more various colors (Hard) |
ユーザー | Kiri8128 |
提出日時 | 2020-05-30 01:58:00 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 450 bytes |
コンパイル時間 | 119 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 40,368 KB |
最終ジャッジ日時 | 2024-04-24 07:48:12 |
合計ジャッジ時間 | 8,127 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 33 ms
16,512 KB |
testcase_01 | AC | 32 ms
11,264 KB |
testcase_02 | AC | 32 ms
11,264 KB |
testcase_03 | AC | 347 ms
12,384 KB |
testcase_04 | AC | 222 ms
12,036 KB |
testcase_05 | AC | 272 ms
12,212 KB |
testcase_06 | AC | 165 ms
11,864 KB |
testcase_07 | AC | 143 ms
11,868 KB |
testcase_08 | AC | 243 ms
12,256 KB |
testcase_09 | AC | 309 ms
12,240 KB |
testcase_10 | AC | 89 ms
11,556 KB |
testcase_11 | AC | 134 ms
11,700 KB |
testcase_12 | AC | 74 ms
11,520 KB |
testcase_13 | TLE | - |
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 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
ソースコード
N, Q = map(int, input().split()) P = 998244353 K = 96 A = [(int(a) - 1) % P for a in input().split()] m = int(("1" * 32 + "0" * 64) * 5010, 2) pa = (1 << 64) - ((1 << 64) % P) modP = lambda x: x - ((x & m) >> 64) * pa s = 1 for i, a in enumerate(A): s *= (1 << K) + a s = modP(s) t = bin(s)[2:] + "_" X = [int(t[-(i+1) * K - 1:-i * K - 1], 2) % P for i in range((len(t)+K-2) // K)] for a in [int(a) for a in input().split()]: print(X[a])