結果
問題 | No.2942 Sigma Music Game Level Problem |
ユーザー | ニックネーム |
提出日時 | 2024-10-18 23:01:26 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 2,593 ms / 6,000 ms |
コード長 | 625 bytes |
コンパイル時間 | 456 ms |
コンパイル使用メモリ | 82,464 KB |
実行使用メモリ | 168,584 KB |
最終ジャッジ日時 | 2024-10-18 23:03:06 |
合計ジャッジ時間 | 25,119 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 37 ms
55,688 KB |
testcase_01 | AC | 39 ms
55,968 KB |
testcase_02 | AC | 39 ms
55,068 KB |
testcase_03 | AC | 38 ms
56,800 KB |
testcase_04 | AC | 55 ms
55,604 KB |
testcase_05 | AC | 38 ms
56,080 KB |
testcase_06 | AC | 37 ms
57,096 KB |
testcase_07 | AC | 42 ms
64,096 KB |
testcase_08 | AC | 67 ms
74,040 KB |
testcase_09 | AC | 54 ms
67,040 KB |
testcase_10 | AC | 51 ms
65,932 KB |
testcase_11 | AC | 912 ms
140,060 KB |
testcase_12 | AC | 2,129 ms
155,548 KB |
testcase_13 | AC | 2,217 ms
107,564 KB |
testcase_14 | AC | 953 ms
157,760 KB |
testcase_15 | AC | 705 ms
155,424 KB |
testcase_16 | AC | 2,094 ms
96,736 KB |
testcase_17 | AC | 476 ms
112,144 KB |
testcase_18 | AC | 1,548 ms
109,084 KB |
testcase_19 | AC | 2,593 ms
109,040 KB |
testcase_20 | AC | 658 ms
132,640 KB |
testcase_21 | AC | 1,664 ms
168,584 KB |
testcase_22 | AC | 1,603 ms
168,300 KB |
testcase_23 | AC | 911 ms
102,620 KB |
testcase_24 | AC | 39 ms
55,480 KB |
testcase_25 | AC | 38 ms
55,408 KB |
testcase_26 | AC | 1,970 ms
167,984 KB |
ソースコード
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!")