|
@@ -0,0 +1,35 @@
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+public class Main {
|
|
|
+ private static final int MOD = 1000000007;
|
|
|
+
|
|
|
+ private static class Node {
|
|
|
+ int color;
|
|
|
+ ArrayList<Node> children;
|
|
|
+
|
|
|
+ Node() {
|
|
|
+ this.children = new ArrayList<>();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ Scanner scanner = new Scanner(System.in);
|
|
|
+ int n = scanner.nextInt();
|
|
|
+ Node[] nodes = new Node[n];
|
|
|
+ nodes[0] = new Node();
|
|
|
+ for (int i = 1, father; i < n; i++) {
|
|
|
+ father = scanner.nextInt();
|
|
|
+ nodes[i] = new Node();
|
|
|
+ nodes[father].children.add(nodes[i]);
|
|
|
+ }
|
|
|
+ for (int i = 0; i < n; i++)
|
|
|
+ nodes[i].color = scanner.nextInt();
|
|
|
+ scanner.close();
|
|
|
+ System.out.println(cutTree(nodes[0]));
|
|
|
+ }
|
|
|
+
|
|
|
+ private static int cutTree(Node root) {
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+}
|