A. Div. 64
来源:互联网 发布:阿里云直播 摄像机 编辑:程序博客网 时间:2024/06/11 13:07
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
解题说明:此题是判断一个二进制数去除一些后能否被64整除,其实就是确保1后面至少有6个0即可。
#include<cstdio>#include<iostream>#include<string>#include<cstring>#include<cmath>using namespace std;char s[105];int main() {scanf("%s", s);int len = strlen(s);int i = 0, cnt = 0;while (s[i] == '0'){i++;}for (; i < len; i++){if (s[i] == '0'){cnt++;}}if (cnt >= 6){printf("yes\n");}else{printf("no\n");}return 0;}
- Codeforces A. Div. 64
- A. Div. 64
- Codeforces 887A Div. 64
- codeforces 887A. Div. 64
- Codeforces Round #444 (Div. 2)A. Div. 64
- Codeforces Round #444 (Div. 2) A. Div. 64
- Codeforces Round #444(Div. 2) A. Div. 64
- BestCoder Round #64 (div.1) A.Sum
- 点击<a>关闭div
- 271 (Div. 2) A
- #323 (Div. 2) A
- 327 (Div. 2)A
- 328 (Div. 2) A
- BestCoder Round #64 (div.2) A Numbers&&HDU 5585
- Code forces 887A Div.64解题报告
- $("parent > child")、$("A B")、$("div#test")、$("div,#test")、$(".test","div")
- $("parent > child")、$("A B")、$("div#test")、$("div,#test")、$(".test","div")
- $("parent > child")、$("A B")、$("div#test")、$("div,#test")、$(".test","div")
- 13.1、异常处理——HandlerExceptionResolver 和@ExceptionHandler
- jQuery
- 学生时代的课外阅读
- HTML5使用rgb颜色值来改变区块颜色
- 导入Mysql数据量大是产生#2006
- A. Div. 64
- Java 比抽象类还要抽象的类-接口interface
- Linux系统下MySQL5.7用source导入sql遇到的种种问题
- java动物模拟器
- darknet YOLO 编译使用GPU
- 强制类型转换运算符
- java版-JQuery上传插件Uploadify使用实例
- POJ2393 Yogurt factory (贪心)
- 变量的作用域,可见性与生存期