VvyLw's Library

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

View the Project on GitHub

:warning: Java/library/ds/unionfind/MergeUnionFind.java

Depends on

Required by

Code

package library.ds.unionfind;

/**
 * UnionFind内でマージテクを使いたい時に使うクラス
 * @param <T>
 */
public abstract class MergeUnionFind<T> extends UnionFind {
	/**
	 * コンストラクタ
	 * @param n
	 */
	public MergeUnionFind(final int n){ super(n); }
	/**
	 * マージテク
	 * @param i
	 * @param j
	 */
	public abstract void merge(final int i, final int j);
	/**
	 * @param i
	 * @return
	 */
	public abstract T get(final int i);
	@Override
	public final boolean unite(int i, int j) {
		i = root(i);
		j = root(j);
		if(i == j) {
			return false;
		}
		if(i > j) {
			i ^= j;
			j ^= i;
			i ^= j;
		}
		par[i] += par[j];
		par[j] = i;
		merge(i, j);
		return true;
	}
}
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/user_defined.py", line 68, in bundle
    raise RuntimeError('bundler is not specified: {}'.format(str(path)))
RuntimeError: bundler is not specified: Java/library/ds/unionfind/MergeUnionFind.java
Back to top page