codeforces 9 div2 C.Hexadecimal's Numbers 暴力打表
1 second
64 megabytes
standard input
standard output
One beautiful July morning a terrible thing happened in Mainframe: a mean virus Megabyte somehow got access to the memory of his not less mean sister Hexadecimal. He loaded there a huge amount of n different natural numbers from 1 to n to obtain total control over her energy.
But his plan failed. The reason for this was very simple: Hexadecimal didn't perceive any information, apart from numbers written in binary format. This means that if a number in a decimal representation contained characters apart from 0 and 1, it was not stored in the memory. Now Megabyte wants to know, how many numbers were loaded successfully.
Input data contains the only number n (1 ≤ n ≤ 109).
Output the only number — answer to the problem.
10
2
For n = 10 the answer includes numbers 1 and 10.
题意:找到只含有数字0或者1的数;
思路:一共512个,打表出来;
#include<bits/stdc++.h>
using namespace std;
#define ll __int64
#define inf 1e18
int ans[]={,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,};
int main()
{
int x,y,z,i,t;
scanf("%d",&x);
for(i=;i<;i++)
{
if(ans[i]>x)
break;
}
cout<<i<<endl;
return ;
}
codeforces 9 div2 C.Hexadecimal's Numbers 暴力打表的更多相关文章
- Educational Codeforces Round 23 C. Really Big Numbers 暴力
C. Really Big Numbers time limit per test 1 second memory limit per test 256 megabytes input standar ...
- Codeforces#543 div2 B. Mike and Children(暴力?)
题目链接:http://codeforces.com/problemset/problem/1121/B 题意 给n个数 最多的对数 其中每一对(i,j)的ai+aj都相等(不知道怎么解释.... 判 ...
- codeforces 351 div2 C. Bear and Colors 暴力
C. Bear and Colors time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- HNUSTOJ-1565 Vampire Numbers(暴力打表)
1565: Vampire Numbers 时间限制: 3 Sec 内存限制: 128 MB提交: 20 解决: 9[提交][状态][讨论版] 题目描述 The number 1827 is an ...
- Codeforces Beta Round #9 (Div. 2 Only) C. Hexadecimal's Numbers dfs
C. Hexadecimal's Numbers 题目连接: http://www.codeforces.com/contest/9/problem/C Description One beautif ...
- Codeforces #180 div2 C Parity Game
// Codeforces #180 div2 C Parity Game // // 这个问题的意思被摄物体没有解释 // // 这个主题是如此的狠一点(对我来说,),不多说了这 // // 解决问 ...
- Codeforces #541 (Div2) - E. String Multiplication(动态规划)
Problem Codeforces #541 (Div2) - E. String Multiplication Time Limit: 2000 mSec Problem Descriptio ...
- Codeforces #541 (Div2) - F. Asya And Kittens(并查集+链表)
Problem Codeforces #541 (Div2) - F. Asya And Kittens Time Limit: 2000 mSec Problem Description Inp ...
- Codeforces #541 (Div2) - D. Gourmet choice(拓扑排序+并查集)
Problem Codeforces #541 (Div2) - D. Gourmet choice Time Limit: 2000 mSec Problem Description Input ...
随机推荐
- 表格table列宽度控制<colgroup>
<colgroup> 标签用于对表格中的列进行组合,以便对其进行格式化. 通过使用 <colgroup> 标签,可以向整个列应用样式,而不需要重复为每个单元格或每一行设置样式. ...
- 转载:隐式Intent
一.隐式意图介绍 显式意图我们前面已经提到,形如: Intent intent = new Intent(); intent.setClass(this,Other.class); //此句表示显式意 ...
- 使用DBMS_SUPPORT包
DBMS_SUPPORT包从Oracle7.2引入,主要功能用以提供更完整的用户session跟踪信息,这个包可以通过运行 dbmssupp.sql 和 prvtsupp.plb 两个脚本来创建.该脚 ...
- linux加载硬盘过程
查看系统可用磁盘大小: [root@i-mbyar7df ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 ...
- 人人网张铁安:Feed系统架构分析(转)
原文:http://www.csdn.net/article/2010-07-26/277273 继成功举办首期TUP活动后,日前在北京丽亭华苑酒店鸿运二厅,由CSDN和<程序员> 杂志联 ...
- macOS Sierra 10.12版本 显示隐藏文件
1.显示隐藏文件 打开Terminal 输入:defaults write com.apple.finder AppleShowAllFiles -bool true 再输入: killall Fin ...
- Windows中杀死某个端口的进程
最近写项目,总是出现端口被占用的问题,原来傻傻的把电脑重启一下,终于有一天受不了了,想要想办法解决.刚开始从网上找了好多教程,发现不行.开始自己尝试,终于,成功的将占用端口的进程杀掉.在此记录下过程( ...
- Mirror--镜像断开的解决办法
如果镜像在搭建一段时候后出现问题,可能存在以下原因: 1. 因为主库或镜像库存在内存压力,导致无法完成镜像日志传送和重做 解决办法:设置数据库最小内存,保证数据库有足够内存完成镜像操作 2. 因为主库 ...
- 202-React.Component组件、生命周期
一.概述 React可以将组件定义为类或函数.定义为类的组件当前提供了更多的功能.要定义React组件类,您需要扩展React.Component: class Welcome extends Rea ...
- Linux(CentOS)系统下搭建svn服务器
由于GitHub的私有项目需要收费,gitlab对服务器的要求必须是4GB内存以上.对于一些个人的小型项目,想要免费的版本控制工具来管理自己的代码,又不想代码公开,无疑SVN是比较好的选择.windo ...