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 ...
随机推荐
- Windows Phone 7 程序等待页面的处理
程序启动通常会有一个等待的过程,在这个过程中可以通过使用Popup控件配合BackgroundWorker类启动后台线程来实现. 控件的代码 PopupSplash.xaml <UserCont ...
- shell脚本分析nginx日志
shell脚本分析nginx日志: name=`awk -F ',' '{print $13":"$32}' $file | awk -F ':' '{print $4}'`ech ...
- IIS Admin Service 服务由于下列服务特定错误而终止: 无效签名。
于是查看系统日志: 具体信息如下:日志名称: System来源: Service Control Manager日期: 2015/11/2 ...
- 让ASP.NET OutputCache使用http.sys kernel-mode cache
在默认情况下,http.sys kerne mode cache只缓存静态文件. 那我们如何让ASP.NET OutputCache直接使用http.sys kerne mode cache?这样缓存 ...
- Python IDLE 安装与使用教程(调试、下载)
原文:http://www.jb51.net/softjc/142580.html ---------------------------------------------------------- ...
- Oracle性能优化之oracle中常见的执行计划及其简单解释
一.访问表执行计划 1.table access full:全表扫描.它会访问表中的每一条记录(读取高水位线以内的每一个数据块). 2.table access by user rowid:输入源ro ...
- 【Python】通过python代码实现demo_test环境的登录,通过csv/txt/excel文件批量添加课程并开启课程操作--(刚开始 项目 页面 模块 元素这种鸟 被称作pageobject 等这些搞完 然后把你的定位器、数据 和脚本在分离 就是传说中那个叫数据驱动 的鸟)
一.1.通过csv文件批量导入数据 1 from selenium import webdriver from time import ctime,sleep import csv #循环读取每一行每 ...
- Keras-图片预处理
图片预处理 图片生成器ImageDataGenerator keras.preprocessing.image.ImageDataGenerator(featurewise_center=False, ...
- 005-线程sleep、join、yield、wait、notify、notifyAll、run、start、synchronized
一.线程sleep join yield wait 1.sleep() 使当前线程(即调用该方法的线程)暂停执行一段时间,让其他线程有机会继续执行,但它并不释放对象锁.也就是说如果有synchroni ...
- Linux java Tomcat 项目中 new Date 获取时间 8小时 时差
转载自: https://blog.csdn.net/liqinghuiyx/article/details/53333284 起因:在本地开发的WEB项目部署到Linux 下后,存入数据库的时间少了 ...