結果

問題 No.2942 Sigma Music Game Level Problem
ユーザー sasa8uyauyasasa8uyauya
提出日時 2024-10-18 22:43:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 3,627 ms / 6,000 ms
コード長 732 bytes
コンパイル時間 716 ms
コンパイル使用メモリ 82,588 KB
実行使用メモリ 244,216 KB
最終ジャッジ日時 2024-10-18 22:54:26
合計ジャッジ時間 30,305 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
55,908 KB
testcase_01 AC 37 ms
56,336 KB
testcase_02 AC 37 ms
56,676 KB
testcase_03 AC 35 ms
56,164 KB
testcase_04 AC 36 ms
56,620 KB
testcase_05 AC 37 ms
55,828 KB
testcase_06 AC 35 ms
55,468 KB
testcase_07 AC 39 ms
61,596 KB
testcase_08 AC 67 ms
75,432 KB
testcase_09 AC 54 ms
68,188 KB
testcase_10 AC 53 ms
66,372 KB
testcase_11 AC 1,030 ms
186,308 KB
testcase_12 AC 2,810 ms
180,356 KB
testcase_13 AC 3,292 ms
117,548 KB
testcase_14 AC 1,313 ms
216,720 KB
testcase_15 AC 535 ms
197,992 KB
testcase_16 AC 2,875 ms
102,156 KB
testcase_17 AC 548 ms
117,388 KB
testcase_18 AC 1,950 ms
125,104 KB
testcase_19 AC 3,515 ms
134,156 KB
testcase_20 AC 598 ms
172,984 KB
testcase_21 AC 958 ms
243,532 KB
testcase_22 AC 943 ms
244,216 KB
testcase_23 AC 1,381 ms
109,184 KB
testcase_24 AC 36 ms
55,288 KB
testcase_25 AC 36 ms
55,532 KB
testcase_26 AC 3,627 ms
199,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q,L0=map(int,input().split())
A=list(map(int,input().split()))
B=448
st11=[0]*B*B
st12=[0]*B
st21=[0]*B*B
st22=[0]*B
for l in A:
  st11[l]+=1
  st12[l//B]+=1
  st21[l]+=l
  st22[l//B]+=l
q2f=0
for _ in range(Q):
  t,*p,=list(map(int,input().split()))
  if t==1:
    l=p[0]
    st11[l]+=1
    st12[l//B]+=1
    st21[l]+=l
    st22[l//B]+=l
  if t==2:
    q2f=1
    l=p[0]
    r=p[1]
    yl=l//B
    yr=r//B
    a1=0
    a2=0
    if yl==yr:
      a1+=sum(st11[l:r+1])
      a2+=sum(st21[l:r+1])
    else:
      a1+=sum(st11[l:yl*B+B])
      a1+=sum(st12[yl+1:yr])
      a1+=sum(st11[yr*B:r+1])
      a2+=sum(st21[l:yl*B+B])
      a2+=sum(st22[yl+1:yr])
      a2+=sum(st21[yr*B:r+1])
    print(a1,a2)
if q2f==0:
  print("Not Found!")
0