結果

問題 No.2942 Sigma Music Game Level Problem
ユーザー ニックネームニックネーム
提出日時 2024-10-18 23:00:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 625 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 74,036 KB
最終ジャッジ日時 2024-10-18 23:01:11
合計ジャッジ時間 15,644 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
13,952 KB
testcase_01 AC 37 ms
13,952 KB
testcase_02 AC 36 ms
13,824 KB
testcase_03 AC 35 ms
13,952 KB
testcase_04 AC 33 ms
13,824 KB
testcase_05 AC 33 ms
13,824 KB
testcase_06 AC 35 ms
13,824 KB
testcase_07 AC 38 ms
13,824 KB
testcase_08 AC 48 ms
13,824 KB
testcase_09 AC 46 ms
13,824 KB
testcase_10 AC 40 ms
13,824 KB
testcase_11 AC 5,800 ms
56,808 KB
testcase_12 TLE -
testcase_13 -- -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

class BIT:
    def __init__(self,n):
        self.n = n; self.k = [0]*(n+1)
    def a(self,i,x):
        while i<=self.n: self.k[i] += x; i += i&-i
    def s(self,i):
        t = 0
        while i>0: t += self.k[i]; i -= i&-i
        return t
    def r(self,l,r): return self.s(r)-self.s(l-1)
n,q,l = map(int,input().split())
m = 200001; b = BIT(m); c = BIT(m); f = 1
for v in map(int,input().split()): b.a(v+1,1); c.a(v+1,v)
for _ in range(q):
    p = list(map(int,input().split()))
    if p[0]==1: b.a(p[1]+1,1); c.a(p[1]+1,p[1])
    if p[0]==2: print(b.r(p[1]+1,p[2]+1),c.r(p[1]+1,p[2]+1)); f = 0
if f: print("Not Found!")
0