codeforces 887A Div. 64 思维 模拟
1 second
256 megabytes
standard input
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.
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
思路:
先统计有多少个0,然后从前往后数,遇到第一个1时,判断后面剩余的0的个数是否大于等于6
代码:
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin>>s;
int len=s.length();
int cnt_zero=;
int cnt_one=;
for(int i=;i<len;++i) {
if(s[i]=='') cnt_zero++;
}
for(int i=;i<len;++i) {
if(s[i]=='') cnt_zero--;
if(s[i]=='') break;
}
if(cnt_zero>=) cout<<"yes"<<endl;
else cout<<"no"<<endl;
return ;
}
codeforces 887A Div. 64 思维 模拟的更多相关文章
- 887A. Div. 64#模特的数学技巧(字符串处理)
问题出处:http://codeforces.com/problemset/problem/887/A 问题大意:对于给出的一串二进制数,能否通过去掉一些数字,使之成为十进制下64的倍数 #inclu ...
- Codeforces 1087C Connect Three (思维+模拟)
题意: 网格图选中三个格,让你选中一些格子把这三个格子连起来,使得选中的格子总数最小.最后输出方案 网格范围为1000 思路: 首先两点间连起来最少需要的格子为他们的曼哈顿距离 然后连接方案一定是曼哈 ...
- Codeforces Round #444 (Div. 2)A. Div. 64【进制思维】
A. Div. 64 time limit per test 1 second memory limit per test 256 megabytes input standard input out ...
- 基于div表单模拟右对齐
基于div表单模拟右对齐 --------------------------------------------------------- ----------------------------- ...
- Codeforces Beta Round #27 (Codeforces format, Div. 2)
Codeforces Beta Round #27 (Codeforces format, Div. 2) http://codeforces.com/contest/27 A #include< ...
- codeforces #592(Div.2)
codeforces #592(Div.2) A Pens and Pencils Tomorrow is a difficult day for Polycarp: he has to attend ...
- codeforces #578(Div.2)
codeforces #578(Div.2) A. Hotelier Amugae has a hotel consisting of 1010 rooms. The rooms are number ...
- Codeforces #344 Div.2
Codeforces #344 Div.2 Interview 题目描述:求两个序列的子序列或操作的和的最大值 solution 签到题 时间复杂度:\(O(n^2)\) Print Check 题目 ...
- Codeforces #345 Div.1
Codeforces #345 Div.1 打CF有助于提高做题的正确率. Watchmen 题目描述:求欧拉距离等于曼哈顿距离的点对个数. solution 签到题,其实就是求有多少对点在同一行或同 ...
随机推荐
- 基于容器微服务的PaaS云平台设计(二)通过kubernetes实现微服务容器管理
版权声明:本文为博主原创文章,欢迎转载,转载请注明作者.原文超链接 ,博主地址:http://www.cnblogs.com/SuperXJ/ 上一章描述了基于spring cloud的微服务实例(实 ...
- iOS之ViewController的多层presentViewController的dismiss问题
今天在Q群里有人问了个这么个问题: A,B,C,D 都是Viewcontroller.A.B.C.D使用present去切的 他是这么搞的: A -> B, B ->C, C->D, ...
- Java基础笔记1
java (开源,跨操作系统)j2ee jre java基础 javaoop java高级 JDK(JAVA developer Kitool): java开发工具 (开发人员使用) JRE(java ...
- Visual paradigm软件介绍
Visual paradigm软件介绍 说起Visual Paradigm你可能并不陌生,因为此前有一款功能强大的UML软件叫Visual Paradigm for UML,在这款软件在v11.1的时 ...
- Cycling
Cycling Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submi ...
- Best Coder #86 1001 Price List(大水题)
Price List Accepts: 880 Submissions: 2184 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 26214 ...
- HDFS--笔记
HDFS的简介 分布式的文件系统,基于流数据模式访问和处理超大文件的分布式文件系统 Hadoop Distributed File System HDFS的优点 处理超大文件 流数据访问 运行廉价的商 ...
- 0_Simple__cppIntegration
引用已经编好的 .cu 和 .cpp 代码来混合使用.在 main.cpp 中调用了使用GPU的 cppIntegration.cu (测试函数也在其中) 和使用CPU的 cppIntegration ...
- 利用echarts highcharts 实现自定义地图 关系图效果 侧边3D柱形图饼图散点图
github 地址: https://https://github.com/Gengshaoxuan/medataMap github 地址: https://https://github.com ...
- IT屌丝如何获取改变自己的真正内心动力
要想从现在的低薪(年薪10万以下)快读变成未来的高新(年薪30万以上)我们要做的就只有从自身改变开始! 人改变自己的勇气,朱啊哟取决于我们自己当前的痛苦程度!直到某一天真的回避不了了,才会被动的改变, ...