competitive-programming-java-library

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

View the Project on GitHub shun0923/competitive-programming-java-library

:heavy_check_mark: library/WeightedDoubling_test.java

Depends on

Code

// verification-helper: PROBLEM https://yukicoder.me/problems/no/1097

package library;

import library.Solver;
import library.AbstractGraph;
import library.WeightedDoubling;

public class WeightedDoubling_test extends Solver {
	public static void main(final String[] args) { main(args, new WeightedDoubling_test()); }

	public void solve() {
		int n = ni();
		var edges = new WeightedListNode(-1);
		for(int i = 0; i < n; i ++) {
			int target = i + ni();
			edges.add(i, target % n, target / n);
		}
		WeightedDoubling db = new WeightedDoubling(n, (long)1e12, 0, (cost1, cost2) -> cost1 + cost2, edges);
		int q = ni();
		for(int i = 0; i < q; i ++) {
			WeightedEdge e = db.cal(0, nl());
			prtln(e.target + e.cost * n);
		}
	}
}
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/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.11.2/x64/lib/python3.11/site-packages/onlinejudge_verify/languages/user_defined.py", line 71, in bundle
    return subprocess.check_output(shlex.split(command))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['false']' returned non-zero exit status 1.
Back to top page