fork download
  1. Scanner scan = new Scanner(System.in);
  2. String s = scan.nextLine()
  3.  
  4. int[] a = new int[100];
  5. for (int i = 0; i < 55; i++) {
  6. a[i]=0;
  7. }
  8.  
  9. for(int k=0;k<100;k++){
  10. for (int i = 49; i >=0; i--) {
  11. a[i] *= 2;
  12. a[i+1] += a[i] / 10;
  13. a[i] %= 10;
  14. }
  15. if(s[k]=='1')a[0]+=1;
  16. }
  17. for (int i = 49; i >=0; i--) {
  18. int p = a[i];
  19. print "$p";
  20. }
Success #stdin #stdout 0.63s 332544KB
stdin
1101010101110000100101001111100110100100010101001000011010000101011001000011110000100101110000110110
stdout
00000000000000000001056902564785013030317595974710