A:暴力。

 1 #include<cstdio>
 2 #include<cstring>
 3 #include<iostream>
 4 #include<algorithm>
 5 #define rep(i,l,r) for (int i=(l); i<=(r); i++)
 6 typedef long long ll;
 7 using namespace std;
 8  
 9 const int N=1010;
10 int n;
11 char s[N];
12  
13 int main(){
14     scanf("%s",s+1); n=strlen(s+1); bool flag=0;
15     rep(i,2,n) if (s[i]=='1') flag=1;
16     if (s[1]=='0'){ puts("0"); return 0; }
17     if (flag) printf("%d",(n+1)/2); else printf("%d\n",n/2);
18     return 0;
19 }
A

相关文章:

  • 2021-11-17
  • 2021-08-12
  • 2021-04-24
  • 2021-12-04
  • 2021-11-19
  • 2021-04-27
  • 2021-08-14
猜你喜欢
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案