Neterukun's Library

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

View the Project on GitHub Neterukun1993/Library

:heavy_check_mark: TestCase/AOJ/0560.BIT.test.py

Depends on

Code

# verification-helper: PROBLEM http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0560
import sys
input = sys.stdin.readline

from DataStructure.BinaryIndexedTree.PointAddRangeSum2D import BinaryIndexedTree


def main():
    m, n = map(int, input().split())
    k = int(input())
    s = [input()[:-1] for i in range(m)]
    queries = [list(map(int, input().split())) for i in range(k)]

    bitJ = BinaryIndexedTree(n, n)
    bitO = BinaryIndexedTree(n, n)
    bitI = BinaryIndexedTree(n, n)

    for i, t in enumerate(s):
        for j, char in enumerate(t):
            if char == "J":
                bitJ.add(i, j, 1)
            elif char == "O":
                bitO.add(i, j, 1)
            else:
                bitI.add(i, j, 1)

    for hl, wl, hr, wr in queries:
        hl -= 1
        wl -= 1
        J = bitJ.sum(hl, hr, wl, wr)
        O = bitO.sum(hl, hr, wl, wr)
        I = bitI.sum(hl, hr, wl, wr)
        print(J, O, I)


if __name__ == '__main__':
    main()
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/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.12.4/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py", line 96, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page