codeforces 877 Div. 64
来源:互联网 发布:雷洋事件最新进展知不 编辑:程序博客网 时间:2024/06/11 01:15
Top-model Izabella participates in the competition. She wants to impress judges and show her mathematical skills.
Her problem is following: for given string, consisting of only 0 and 1, tell if it's possible to remove some digits in such a way, that remaining number is a representation of some positive integer, divisible by 64, in the binary numerical system.
In the only line given a non-empty binary string s with length up to 100.
Print «yes» (without quotes) if it's possible to remove digits required way and «no» otherwise.
100010001
yes
100
no
In the first test case, you can get string 1 000 000 after removing two ones which is a representation of number 64 in the binary numerical system.
You can read more about binary numeral system representation here:https://en.wikipedia.org/wiki/Binary_system
#include<string>
using namespace std;
int main()
{
int zero=0,i,j,one=0;
string a;
cin>>a;
int len=a.length();
for(i=0;i<len;i++)
{
if(a[i]=='0')
zero++;
}
for(j=0;j<len;j++)
{
if(a[j]=='0')
zero--;
else
{
one++;
break;
}
}
if(zero>=6&&one==1)
cout<<"yes"<<endl;
else
cout<<"no"<<endl;
}
- codeforces 877 Div. 64
- Codeforces A. Div. 64
- Codeforces 887A Div. 64
- codeforces 887A. Div. 64
- Codeforces Round #442 (Div. 2) 877 F
- Codeforces Round #877 (Div. 2) B.
- Codeforces Round #444 (Div. 2)A. Div. 64
- Codeforces Round #444 (Div. 2) A. Div. 64
- Codeforces Round #444(Div. 2) A. Div. 64
- 【每日一题(6)】Div. 64 CodeForces
- codeForces #140 div 2
- codeforces #149 div 2
- Codeforces #154 div 2
- Codeforces 156 div.2
- codeforces 167 div 2
- codeforces #176 div.2
- Codeforces 193 Div 2
- codeforces round 200Div
- c#中的常量和静态变量
- 打印三角形、已三角形方式 输出数组中的内容
- 已知密文求明文
- JVM垃圾处理方法
- mircosoft azure
- codeforces 877 Div. 64
- 理解JavaScript闭包
- 完美三元组
- c#中的程序集和命名空间
- 复制二叉树
- 【Python】生成器和杨辉三角
- HDU-1421 搬寝室 (线性dp 好题)
- TheInternet's own boy:Aaron Swartz
- 【Java 设计模式】接口型模式--Adapter(适配器)模式