fork download
  1. import java.io.*;
  2. import java.util.Scanner;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. Scanner in = new Scanner(System.in);
  9. long n = in.nextLong();
  10. long x = 1;
  11. long k = 1;
  12. long s = 1;
  13. while (s<n) {
  14. k++;
  15. x = x*2 + k;
  16. s = s + x;
  17. }
  18. System.out.print(k);
  19. }
  20. }
Success #stdin #stdout 0.08s 2184192KB
stdin
15
stdout
3