C. Hexadecimal's Numbers
time limit per test

1 second

memory limit per test

64 megabytes

input

standard input

output

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

Input data contains the only number n (1 ≤ n ≤ 109).

Output

Output the only number — answer to the problem.

Examples
input
10
output
2
Note

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 暴力打表的更多相关文章

  1. 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 ...

  2. Codeforces#543 div2 B. Mike and Children(暴力?)

    题目链接:http://codeforces.com/problemset/problem/1121/B 题意 给n个数 最多的对数 其中每一对(i,j)的ai+aj都相等(不知道怎么解释.... 判 ...

  3. 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 ...

  4. HNUSTOJ-1565 Vampire Numbers(暴力打表)

    1565: Vampire Numbers 时间限制: 3 Sec  内存限制: 128 MB提交: 20  解决: 9[提交][状态][讨论版] 题目描述 The number 1827 is an ...

  5. 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 ...

  6. Codeforces #180 div2 C Parity Game

    // Codeforces #180 div2 C Parity Game // // 这个问题的意思被摄物体没有解释 // // 这个主题是如此的狠一点(对我来说,),不多说了这 // // 解决问 ...

  7. Codeforces #541 (Div2) - E. String Multiplication(动态规划)

    Problem   Codeforces #541 (Div2) - E. String Multiplication Time Limit: 2000 mSec Problem Descriptio ...

  8. Codeforces #541 (Div2) - F. Asya And Kittens(并查集+链表)

    Problem   Codeforces #541 (Div2) - F. Asya And Kittens Time Limit: 2000 mSec Problem Description Inp ...

  9. Codeforces #541 (Div2) - D. Gourmet choice(拓扑排序+并查集)

    Problem   Codeforces #541 (Div2) - D. Gourmet choice Time Limit: 2000 mSec Problem Description Input ...

随机推荐

  1. 使用SSH工具连接到MySQL

    在SSH中查看MySQL数据信息 格式为:mysql -h主机地址 -u用户名 -p用户密码 -P端口号 -D数据库名称 例如: mysql -uroot -p123456 -h192.168.1.1 ...

  2. 使用MySQLMTOP监控MySQL性能(一)

    一.环境说明 1.服务器角色 服务器角色 172.18.35.29 10.160.22.14 (MySQL Master) 10.160.22.47 (MySQL Slave) 监控点 YES NO ...

  3. Elasticsearch之settings和mappings(图文详解)

    Elasticsearch之settings和mappings的意义 简单的说,就是 settings是修改分片和副本数的. mappings是修改字段和类型的. 记住,可以用url方式来操作它们,也 ...

  4. Python基础之软件目录结构规范

    设计一个层次清晰的目录结构,就是为了达到这两点: 可读性高:不熟悉项目的人,一眼就能看懂目录结构. 可维护性高:随着时间的推移,代码/配置的规模增加,项目结构不会混乱,仍然能够组织良好. 目录组织方式 ...

  5. 个人理解---KMP与Next数组详解

    Kmp就是求子串在母串中的位置等相关问题:当然KMP最重要的是Next数组,也称失败数组,Next[i]代表的意思是子串 sub 从sub[0] 到 sub[i-1]的前缀和后缀的最大匹配.模拟KMP ...

  6. Python开发【模块】:time、datatime

    时间模块 时间相关的操作,时间有三种表示方式: 时间戳               1970年1月1日之后的秒,即:time.time() 格式化的字符串    2014-11-11 11:11,   ...

  7. yii2框架(一)安装

    手动安装下载yii2basic出现以下错误 2 修改 G:\learn\yii-basic-app-2.0.11\basic\config下web.conf 为cookieValidationKey设 ...

  8. Python性能鸡汤(转)

    英文原文:http://blog.monitis.com/index.php/2012/02/13/python-performance-tips-part-1/ 英文原文:http://blog.m ...

  9. Oracle SQL语句积累

    字段合并: select EVFOUNDATIONTYPEA || EVFOUNDATIONTYPEB|| EVFOUNDATIONTYPEC ||EVFOUNDATIONTYPED as b fro ...

  10. 1107 Social Clusters[并查集][难]

    1107 Social Clusters(30 分) When register on a social network, you are always asked to specify your h ...