1 #include<cstdio>
 2 #include<iostream>
 3 #include<string>
 4 using namespace std;
 5 string s;
 6 int n,pow2[32];
 7 long long ans;
 8 void init()
 9 {
10     pow2[0]=1;
11     for(int i=1;i<=31;i++) pow2[i]=(pow2[i-1]<<1);
12 }
13 int main()
14 {
15     scanf("%d",&n); init();
16     for(int i=1;i<=n;i++)
17       {
18           cin>>s;
19           int len=s.length(),res=0;
20           for(int i=len-1,j=0;i>=0;i--,j++) res+=pow2[j]*(s[i]-'0');
21           ans+=(long long)res;
22       }
23     printf("%lld\n",ans);
24     return 0;
25 }

 

相关文章:

  • 2021-10-14
  • 2021-08-20
  • 2022-02-20
  • 2021-12-17
  • 2021-09-17
猜你喜欢
  • 2022-02-04
  • 2021-07-06
  • 2021-09-21
  • 2021-11-14
  • 2021-09-05
  • 2021-08-18
  • 2021-06-09
相关资源
相似解决方案