fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. long long n=1000000000000;
  13. int ans=0;
  14. while(n!=1)
  15. {
  16. if(n%3==0){
  17. ans += 1;
  18. n/=3; }
  19. else if (n%2==0){
  20. ans += 1;
  21. n/=2;}
  22. else {
  23. n--;ans++;
  24. }
  25. }
  26. System.out.println(ans);
  27. }
  28. }
Compilation error #stdin compilation error #stdout 0.06s 380224KB
stdin
5
compilation info
Main.java:12: error: not a statement
		long long n=1000000000000;
		^
Main.java:12: error: ';' expected
		long long n=1000000000000;
		    ^
Main.java:12: error: integer number too large: 1000000000000
		long long n=1000000000000;
		            ^
3 errors
stdout
Standard output is empty