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/PathRestoration.java

Depends on

Verified with

Code

package library;

import java.util.*;
import library.FastIO;
import library.AbstractGraph;

final class PathRestoration {
	public static final int[] path(final int[] prv, final int start, int goal) { // O(V)
		FastIO.rangeCheck(start, prv.length);
		FastIO.rangeCheck(goal, prv.length);
		List<Integer> pathList = new ArrayList<>();
		pathList.add(goal);
		while(goal != start) pathList.add(goal = prv[goal]);
		final int path[] = new int[pathList.size()];
		for(int i = 0, j = path.length - 1; i < path.length; i ++, j --) path[i] = pathList.get(j);
		return path;
	}
	public static final <Edge extends AbstractEdge<Edge>> List<Edge> pathEdge(final int[] prv, final Edge[] prvEdge, final int start, final int goal) {
		int path[] = path(prv, start, goal);
		List<Edge> pathEdge = new ArrayList<>(path.length);
		for(int i = 1; i < path.length; i ++) pathEdge.add(prvEdge[path[i]]);
		return pathEdge;
	}
}
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