Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /**
- * Created by entsmv on 29.03.2017.
- */
- public class Solution {
- private static void Remove(int id) {
- }
- private static void Find(int id) {
- }
- private static void Add(int idp, int idc) {
- }
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = scanner.nextInt();
- StringBuilder answer;
- for (int i = 0; i < n; i++) {
- String s = scanner.next();
- if (s.equals("ADD")) {
- int idp = scanner.nextInt();
- int idc = scanner.nextInt();
- Add(idp, idc);
- }
- else if (s.equals("FIND")) {
- int id = scanner.nextInt();
- Find(id);
- }
- else {
- int id = scanner.nextInt();
- Remove(id);
- }
- }
- }
- public class Edge {
- int x;
- int deep = 0;
- Edge left = null, right = null;
- public Edge(int x, int deep, Edge left, Edge right) {
- this.x = x;
- this.deep = deep;
- this.left = left;
- this.right = right;
- }
- public int getX() {
- return x;
- }
- public void setX(int x) {
- this.x = x;
- }
- public int getDeep() {
- return deep;
- }
- public void setDeep(int deep) {
- this.deep = deep;
- }
- public Edge getLeft() {
- return left;
- }
- public void setLeft(Edge left) {
- this.left = left;
- }
- public Edge getRight() {
- return right;
- }
- public void setRight(Edge right) {
- this.right = right;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement