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 32 ms 12 MB
Python max_random_00 :heavy_check_mark: AC 4210 ms 71 MB
Python max_random_01 :heavy_check_mark: AC 4150 ms 71 MB
Python max_random_02 :heavy_check_mark: AC 4124 ms 71 MB
Python max_random_03 :heavy_check_mark: AC 4334 ms 71 MB
Python max_random_04 :heavy_check_mark: AC 4169 ms 71 MB
Python random_00 :heavy_check_mark: AC 3487 ms 55 MB
Python random_01 :heavy_check_mark: AC 3848 ms 63 MB
Python random_02 :heavy_check_mark: AC 2277 ms 17 MB
Python random_03 :heavy_check_mark: AC 936 ms 61 MB
Python random_04 :heavy_check_mark: AC 1096 ms 42 MB
Python small_00 :heavy_check_mark: AC 33 ms 12 MB
Python small_01 :heavy_check_mark: AC 33 ms 12 MB
Python small_02 :heavy_check_mark: AC 33 ms 12 MB
Python small_03 :heavy_check_mark: AC 32 ms 12 MB
Python small_04 :heavy_check_mark: AC 33 ms 12 MB
Python small_05 :heavy_check_mark: AC 36 ms 12 MB
Python small_06 :heavy_check_mark: AC 33 ms 12 MB
Python small_07 :heavy_check_mark: AC 33 ms 12 MB
Python small_08 :heavy_check_mark: AC 33 ms 12 MB
Python small_09 :heavy_check_mark: AC 33 ms 12 MB
Back to top page