codeforces 887A Div. 64 思维 模拟
发布日期:2021-05-09 04:21:28 浏览次数:18 分类:博客文章

本文共 1223 字,大约阅读时间需要 4 分钟。

A. Div. 64
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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.

Input

In the only line given a non-empty binary string s with length up to 100.

Output

Print «yes» (without quotes) if it's possible to remove digits required way and «no» otherwise.

Examples
input
100010001
output
yes
input
100
output
no
Note

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: 

 

思路:

先统计有多少个0,然后从前往后数,遇到第一个1时,判断后面剩余的0的个数是否大于等于6

代码:

1 #include 
2 using namespace std; 3 int main() { 4 string s; 5 cin>>s; 6 int len=s.length(); 7 int cnt_zero=0; 8 int cnt_one=0; 9 for(int i=0;i
=6) cout<<"yes"<
View Code

 

上一篇:51Nod 1084 矩阵取数问题 V2 双线程DP 滚动数组优化
下一篇:codeforces 887B Cubes for Masha 两种暴力

发表评论

最新留言

路过按个爪印,很不错,赞一个!
[***.219.124.196]2025年04月04日 03时20分10秒