fork download
  1. int main() {
  2. string s=Stdio.stdin.gets();
  3. int i=strlen(s);
  4. int res=0;
  5. int j=i-1;
  6. while(j>=0){
  7. if(s[j]==49){
  8. res= res+pow(2,i-j-1);
  9. }
  10. j = j-1;
  11. }
  12. write("%d\n",res);
  13. return 0;
  14. }
Success #stdin #stdout 0.04s 10120KB
stdin
1100001001101101000011010010010111011011100000111010000000111000010110111000111010010000001100010010
stdout
962750830540646534807386915602