結果
問題 | No.1068 #いろいろな色 / Red and Blue and more various colors (Hard) |
ユーザー |
![]() |
提出日時 | 2020-05-30 00:20:23 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 879 bytes |
コンパイル時間 | 255 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 44,648 KB |
最終ジャッジ日時 | 2024-11-06 09:41:04 |
合計ジャッジ時間 | 7,456 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 TLE * 1 -- * 18 |
ソースコード
import sys, heapq as hqreadline = sys.stdin.readlinek = 70K = 1<<kns = lambda: readline().rstrip()ni = lambda: int(readline().rstrip())nm = lambda: map(int, readline().split())nl = lambda: list(map(int, readline().split()))nu = lambda L: int("".join([bin(K+a)[-k:] for a in L[::-1]]), 2)st = lambda n: bin(n)[2:] + "0"li = lambda s, p, q: [int(a, 2) if len(a) else 0 for a in [s[-(i+1)*k-1:-i*k-1] for i in range(p+q-1)]]def solve():mod = 998244353n, q = nm()a = nl()def recurr(l, r):if l + 1 == r:return [a[l]-1, 1]res1 = recurr(l, (l+r)//2)res2 = recurr((l+r)//2, r)res = li(st(nu(res1) * nu(res2)), len(res1), len(res2))for i in range(len(res)):res[i] %= modreturn resp = recurr(0, n)b = nl()for x in b:print(p[x])returnsolve()