結果
| 問題 |
No.2942 Sigma Music Game Level Problem
|
| コンテスト | |
| ユーザー |
ニックネーム
|
| 提出日時 | 2024-10-18 23:00:02 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 625 bytes |
| コンパイル時間 | 292 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 72,120 KB |
| 最終ジャッジ日時 | 2024-11-07 22:03:44 |
| 合計ジャッジ時間 | 16,082 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 TLE * 1 -- * 14 |
ソースコード
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!")
ニックネーム