fork download
  1. import java.io.*;
  2. import java.util.*;
  3. import java.lang.*;
  4. import java.math.*;
  5.  
  6. public class Main{
  7. public static void main(String[] args)throws IOException{
  8. while(true){
  9. Long n = Long.parseLong(br.readLine());
  10. n--;
  11. int idx = 0;
  12. while(n > 0){
  13. idx++;
  14. if(n % 2 == 1){
  15. BigInteger v = new BigInteger("1");
  16. for(int i = 0; i < idx; i++)
  17. v.multiply("3");
  18. System.out.println(v);
  19. }
  20. n /= 2;
  21. }
  22. }
  23. }
  24. }
  25.  
  26.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
10
compilation info
Main.java:18: error: no suitable method found for multiply(String)
			v.multiply("3");
			 ^
    method BigInteger.multiply(BigInteger) is not applicable
      (argument mismatch; String cannot be converted to BigInteger)
    method BigInteger.multiply(long) is not applicable
      (argument mismatch; String cannot be converted to long)
1 error
stdout
Standard output is empty