Datasets:
ArXiv:
License:
Download data/train/ToreAad/Inf102/src/java/exercises/FakeboolQuickFind.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 767 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/main/data/train/ToreAad/Inf102/src/java/exercises/FakeboolQuickFind.java
- Command line
-
hf download hf://datasets/RepoFusion/Stack-Repo/data/train/ToreAad/Inf102/src/java/exercises/FakeboolQuickFind.java
-
curl -L -o FakeboolQuickFind.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/main/data/train/ToreAad/Inf102/src/java/exercises/FakeboolQuickFind.java
767 Bytes
| package torea; | |
| import java.lang.StringBuilder; | |
| public class FakeboolQuickFind{ | |
| public static void main(String[] args){ | |
| Kattio io = new Kattio(System.in, System.out); | |
| int nrUsers = io.getInt(); | |
| int nrUnions = io.getInt(); | |
| UnionFind.QuickFind qf = new UnionFind.QuickFind(nrUsers); | |
| for(int i = 0; i< nrUnions; i++){ | |
| int a = io.getInt(); | |
| int b = io.getInt(); | |
| qf.union(a, b); | |
| } | |
| StringBuilder sb = new StringBuilder(); | |
| for(int i = 0; i < nrUsers; i++){ | |
| sb.append(qf.id[i]).append(" "); | |
| // if (i != nrUsers - 1) sb.append(" "); | |
| } | |
| io.print(sb); | |
| io.flush(); | |
| io.close(); | |
| } | |
| } |