AtCoder Python Library for yatabis

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub yatabis/atcoder-python-library

:heavy_check_mark: verify/data_structure/static_range_sum.test.py

Depends on

Code

# verification-helper: PROBLEM https://judge.yosupo.jp/problem/static_range_sum
from lib.sample.io import read


def main():
    n, q = map(int, read().split())
    a = [int(i) for i in read().split()]
    aa = [0] * (n + 1)
    for i in range(n):
        aa[i + 1] = aa[i] + a[i]
    for _ in range(q):
        l, r = map(int, read().split())
        print(aa[r] - aa[l])


if __name__ == '__main__':
    main()
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/onlinejudge_verify/documentation/build.py", line 71, in _render_source_code_stat
    bundled_code = language.bundle(stat.path, basedir=basedir, options={'include_paths': [basedir]}).decode()
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/onlinejudge_verify/languages/python.py", line 96, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page