fork download
  1.  
  2. import java.io.BufferedReader;
  3. import java.io.IOException;
  4. import java.io.InputStreamReader;
  5. import java.io.StreamTokenizer;
  6. import java.util.ArrayList;
  7. import java.util.Collections;
  8. import java.util.Iterator;
  9. import java.util.TreeSet;
  10. import java.lang.Integer;
  11.  
  12. public class boxes_kp_java {
  13.  
  14.  
  15. static int nextInt() {
  16. try {
  17. st.nextToken();
  18. return (int) st.nval;
  19. } catch (IOException ex) {
  20. return 0;
  21. }
  22. }
  23.  
  24. public static void main(String[] args) {
  25. int n = nextInt();
  26. int m = 0;
  27. int k, a;
  28. for (int i = 0; i < n; i++) {
  29. k = nextInt();
  30. a = nextInt();
  31. int tm = k + 1;
  32. if (a > 1) {
  33. int p = 0;
  34. int v = 1;
  35. while (v < a) {
  36. v *= 4;
  37. p++;
  38. }
  39.  
  40. tm = p + k;
  41. }
  42. m = Math.max(m, tm);
  43.  
  44. }
  45. System.out.println(m);
  46. }
  47. }
  48.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:12: error: class boxes_kp_java is public, should be declared in a file named boxes_kp_java.java
public class boxes_kp_java {
       ^
1 error
stdout
Standard output is empty