library

This documentation is automatically generated by competitive-verifier/competitive-verifier

View the Project on GitHub hidehic0/library

:heavy_check_mark: tests/bit.py

Depends on

Code

# competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/point_add_range_sum
from libs.bit import BIT
from libs.standard_input import *

N, Q = il()
A = il()
bit = BIT(N)

for i in range(N):
    bit.add(i + 1, A[i])

while Q:
    lis = il()
    if lis[0] == 0:
        bit.add(lis[1] + 1, lis[2])
    else:
        print(bit.interval_sum(lis[1], lis[2]))

    Q -= 1

Test cases

Env Name Status Elapsed Memory
Python example_00 :heavy_check_mark: AC 33 ms 12 MB
Python max_random_00 :heavy_check_mark: AC 4532 ms 71 MB
Python max_random_01 :heavy_check_mark: AC 4329 ms 71 MB
Python max_random_02 :heavy_check_mark: AC 4304 ms 71 MB
Python max_random_03 :heavy_check_mark: AC 4159 ms 71 MB
Python max_random_04 :heavy_check_mark: AC 4201 ms 71 MB
Python random_00 :heavy_check_mark: AC 3537 ms 55 MB
Python random_01 :heavy_check_mark: AC 3700 ms 63 MB
Python random_02 :heavy_check_mark: AC 2337 ms 17 MB
Python random_03 :heavy_check_mark: AC 898 ms 59 MB
Python random_04 :heavy_check_mark: AC 1081 ms 42 MB
Python small_00 :heavy_check_mark: AC 36 ms 12 MB
Python small_01 :heavy_check_mark: AC 36 ms 12 MB
Python small_02 :heavy_check_mark: AC 36 ms 12 MB
Python small_03 :heavy_check_mark: AC 36 ms 12 MB
Python small_04 :heavy_check_mark: AC 36 ms 12 MB
Python small_05 :heavy_check_mark: AC 34 ms 12 MB
Python small_06 :heavy_check_mark: AC 34 ms 12 MB
Python small_07 :heavy_check_mark: AC 34 ms 12 MB
Python small_08 :heavy_check_mark: AC 34 ms 12 MB
Python small_09 :heavy_check_mark: AC 34 ms 12 MB
Back to top page