verification-helper

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

View the Project on GitHub online-judge-tools/verification-helper

:heavy_check_mark: examples/csharpscript/segment_tree.range_sum_query.test.csx

Depends on

Code

#load "./segment_tree.csx"
#pragma PROBLEM https://onlinejudge.u-aizu.ac.jp/courses/library/3/DSL/all/DSL_2_B

using System;
using System.Linq;

var nq = Console.ReadLine().Split().Select(int.Parse).ToArray();
var (n, q) = (nq[0], nq[1]);
SegmentTree<int> segTree = new SegmentTree<int>(n, 0, (x, y) => x + y);

for (int i = 0; i < q; i++)
{
    var query = Console.ReadLine().Split().Select(int.Parse).ToArray();
    if (query[0] == 0)
    {
        segTree[query[1] - 1] += query[2];
    }
    else
    {
        Console.WriteLine(segTree[(query[1] - 1)..query[2]]);
    }
}
Traceback (most recent call last):
  File "/home/runner/.local/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 "/home/runner/.local/lib/python3.10/site-packages/onlinejudge_verify/languages/csharpscript.py", line 113, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page