Codeforces Round #444 (Div. 2)A. 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的字符串 , 判断这个 字符串 能不能通过删除一些1或者0 使得剩下的数字是一个整数的二进制表示,并且能够被二进制的 64 整除。
【分析】:64 的二进制表示是:1000000(2) , 从给出的数字的最高位向后找到第一个 1 然后向后统计 0 的个数 num, num大于等于 6 则输出 yes 否则输出 no
【代码】:
#include <bits/stdc++.h> using namespace std;
char s[];
int main()
{
scanf("%s",s);
int flag=,cnt=;
for(int i=;i<strlen(s);i++)
{
if(flag== && s[i]=='')
{
flag=;
}
if(flag)
{
if(s[i]=='')
{
cnt++;
}
}
}
if(cnt>=)
printf("yes\n");
else
printf("no\n");
return ;
}
Codeforces Round #444 (Div. 2)A. Div. 64【进制思维】的更多相关文章
- Codeforces Round #539Ȟȟȡ (Div. 1) 简要题解
Codeforces Round #539 (Div. 1) A. Sasha and a Bit of Relax description 给一个序列\(a_i\),求有多少长度为偶数的区间\([l ...
- Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 2) 题解
Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 2) 题目链接:https://codeforces.com/contest/1130 ...
- javascript 10进制和64进制的转换
原文:javascript 10进制和64进制的转换 function string10to64(number) { var chars = '0123456789abcdefghigklmnopqr ...
- PHP进制转换[实现2、8、16、36、64进制至10进制相互转换]
自己写了一个PHP进制转换程序,一个类吧,第一次写这个东东,写这个东东,在处理文本文件时能用得到. 可以实现: 10进制转换2.8.16.36.62进制2.8.16.36.62进制转换10进制 有 ...
- 实验吧-杂项-64格(64进制--base64索引)
下载gif,Winhex打开发现文件头缺失,加上文件头GIF89得到正常图片,用帧分解工具把每一帧分解. 图片主要是一个8×8的方格,好像没什么线索,把每一帧图片上小黄人的占格的位置数出: 17 54 ...
- Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 1) C(二分+KMP)
http://codeforces.com/contest/1129/problem/C #include<bits/stdc++.h> #define fi first #define ...
- Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 2) A - D2
A. Be Positive 链接:http://codeforces.com/contest/1130/problem/A 题意: 给一段序列,这段序列每个数都除一个d(−1e3≤d≤1e3)除完后 ...
- codeforces水题100道 第二十五题 Codeforces Round #197 A. Helpful Maths (Div. 2) (strings)
题目链接:http://www.codeforces.com/problemset/problem/339/A题意:重新组合加法字符串,使得按照1,2,3的顺序进行排列.C++代码: #include ...
- Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 1) 题解
A. Toy Train 时间限制:2 seconds 内存限制:256 megabytes 题意 有编号111~n(n≤5000)n(n\le 5000)n(n≤5000)的车站顺时针呈环排列,有m ...
随机推荐
- 二叉树 【转】http://blog.csdn.net/sjf0115/article/details/8645991
//二叉树 #include<iostream> #include<stack> #include<queue> using namespace std; //二叉 ...
- script通过script标签跨域加载数据
/********************************************************** 说明:跨域请求数据Javascript组件 ------------------ ...
- Python列表深浅复制详解
转自:https://www.cnblogs.com/blaomao/p/7239203.html 在文章<Python 数据类型>里边介绍了列表的用法,其中列表有个 copy() 方法, ...
- 抓包工具 - Fiddler - (二)
<转载自 miantest> 在上一篇中介绍了Fiddler的基本使用方法.通过上一篇的操作我们可以直接抓取浏览器的数据包.但在APP测试中,我们需要抓取手机APP上的数据包,应该怎么操作 ...
- ASP.Net MVC+EF架构
ASP.Net MVC是UI层的框架,EF是数据访问的逻辑. 如果在Controller中using DbContext,把查询的结果的对象放到cshtml中显示,那么一旦在cshtml中访问关联属性 ...
- Python全栈 MySQL 数据库 (简述 、安装、基本命令)
ParisGabriel 每天坚持手写 一天一篇 决定坚持几年 为了梦想为了信仰 开局一张图 一个月的python已经结束了 下面就是数据库了 先说M ...
- (原)Unreal渲染模块 管线 - 程序和场景查询
@author: 白袍小道 查看随意,转载随缘 第一部分: 这里主要关心加速算法,和该阶段相关的UE模块的结构和组件的处理. What-HOW-Why-HOW-What(嘿嘿,老规矩) 1.渲 ...
- Android 启动项 Activity
使用SDK创建一个App的时候,基本都会看到这段代码: <activity android:name=".ExampleActivity" android:icon=&quo ...
- django之HTTPResponse和JsonResponse详解
HttpResponse对象 Django服务器接收到客户端发送过来的请求后,会将提交上来的这些数据封装成一个HttpRequest对象传给视图函数.那么视图函数在处理完相关的逻辑后,也需要返回一个响 ...
- 爬虫:Scrapy11 - Logging
Scrapy 提供了 log 功能.可以通过 scrapy.log 模块使用.当前底层实现使用了 Twisted logging,不过可能在之后会有所变化. log 服务必须通过显式调用 scrapy ...