fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. SortedSet<int[]> s = new TreeSet<int[]>(new Comparator<int[]>(){
  11. public int compare(int[] a, int[] b) {
  12. return b[0] - a[0];
  13. }
  14. });
  15. int[] a = new int[]{1, 2};
  16. int[] b = new int[]{1, 3};
  17. s.add(a);
  18. s.add(b);
  19. System.out.println(s.size());
  20. }
  21. }
Success #stdin #stdout 0.09s 320576KB
stdin
Standard input is empty
stdout
1