fork(1) download
  1. import java.util.Scanner;
  2. import java.util.List;
  3. import java.io.IOException;
  4. import java.util.Arrays;
  5. import java.util.Set;
  6. import java.io.OutputStream;
  7. import java.io.PrintWriter;
  8. import java.util.TreeSet;
  9. import java.util.LinkedList;
  10. import java.util.HashSet;
  11. import java.io.InputStream;
  12.  
  13. /**
  14.  * Built using CHelper plug-in
  15.  * Actual solution is at the top
  16.  */
  17. public class Main {
  18. public static void main(String[] args) {
  19. InputStream inputStream = System.in;
  20. OutputStream outputStream = System.out;
  21. Scanner in = new Scanner(inputStream);
  22. PrintWriter out = new PrintWriter(outputStream);
  23. TaskE solver = new TaskE();
  24. solver.solve(1, in, out);
  25. out.close();
  26. }
  27. }
  28.  
  29. class TaskE {
  30.  
  31. class Vertex implements Comparable<Vertex> {
  32. long dist;
  33. int v;
  34.  
  35. public Vertex(long dist, int v) {
  36. this.dist = dist;
  37. this.v = v;
  38. }
  39.  
  40. public int compareTo(Vertex o) {
  41. // if (dist == o.dist) return Integer.compare(v, o.v);
  42.  
  43. return Long.compare(dist, o.dist);
  44. }
  45. }
  46.  
  47. public void solve(int testNumber, Scanner in, PrintWriter out) {
  48. TreeSet<Vertex> q = new TreeSet<Vertex>();
  49. q.add(new Vertex(0, 1));
  50. q.add(new Vertex(0, 2));
  51. out.println(q.size());
  52. }
  53. }
Success #stdin #stdout 0.14s 321088KB
stdin
Standard input is empty
stdout
1