Archives: Lucky Numbers

Advertisement

[2016-04-14][codeforces][630][C][ Lucky Numbers]

时间:2016-04-14 23:12:27 星期四 题目编号:[2016-04-14][codeforces][630][C][ Lucky Numbers] 题目大意: 问n位数字以内的幸运数字有多少个 幸运数字:只含有7,8的数字 分析: 长度为i 的幸运数字,每一位有两种可能,7 , 8,那么长度为i的幸运数字总共有 $2^i$中可能 那么长度为n 以内的所有幸运数字 就是 $2^1 + 2^2 + - + 2^n$, #include<cstdio> using namespace

hdu5676 ztr loves lucky numbers (打表二分)

ztr loves lucky numbers Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1132 Accepted Submission(s): 478 Problem Description ztr loves lucky numbers. Everybody knows that positive integers are luc

CodeForces - 96B Lucky Numbers (easy)

Lucky Numbers (easy) Time Limit: 2000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Submit Status Description Petya loves lucky numbers. Everybody knows that positive integers are lucky if their decimal representation doesn't contain digits

CF - 244B - Undoubtedly Lucky Numbers

题意:用x和y组成不大于n的整数有多少个(0 ≤ x,  y ≤ 9,1 ≤ n ≤ 10^9). 题目链接:http://codeforces.com/problemset/problem/244/B -->>枚举x, y,将其所有组成的数放入set,最后看set里有多少个元素就好. #include <cstdio> #include <set> using namespace std; int n; set<long long> se; void Fi

hdu ztr loves lucky numbers (最小的但不小于n的幸运数字是多少,幸运数字只含4和7,且4的个数等于7的个数)

ztr喜欢幸运数字,他对于幸运数字有两个要求 1:十进制表示法下只包含4.7 2:十进制表示法下4和7的数量相等 比如47,474477就是 而4,744,467则不是 现在ztr想知道最小的但不小于n的幸运数字是多少 有T组数据,(T<=10^5),n<=10^18 思路: 因为2^19小于10^6,所以我们可以把所有的数全部预处理存起来,然后每次查询就是找比他大的数是哪一个就可以了,这里有一个坑点就是最后输出的数可能超过long long的范围,但是只有一种情况,就是输出444444444

HDU 5665 Lucky——BestCoder Round #80

Lucky Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 0    Accepted Submission(s): 0 Problem Description Chaos August likes to study the lucky numbers. For a set of numbers S,we set the minimum

hdu 5665 Lucky【水题】

Lucky Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 213    Accepted Submission(s): 143 Problem Description Chaos August likes to study the lucky numbers. For a set of numbers S,we set the min

codefroces 110A Nearly Lucky Number(模拟水题)

A. Nearly Lucky Number 点击打开题目 time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representati

Codeforces 109 C. Lucky Tree

反面考虑,找到所有的边都不是Lucky digits的联通块,若块中的点有x个,则不是 triples 的数量为 : X*(X-1)*(X-2)-2LL*X*(X-1)*(n-X) C. Lucky Tree time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Petya loves lucky numbers. We all k

CF 110A Nearly Lucky Number

Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. Unfortunately, not all numbers

URAL 1036(dp+高精度)

Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice URAL 1036 Description You are given a number 1 ≤ N ≤ 50. Every ticket has its 2 N-digit number. We call a ticket lucky, if the sum of its first N digits is eq

(转载)uva题目难度分级列表

# ID Title Solved by Difficulty 1 100 The 3n + 1 problem 26485 1 2 102 Ecological Bin Packing 10608 2 3 10071 Back to High School Physics 9554 3 4 10055 Hashmat the Brave Warrior 9432 3 5 272 TEX Quotes 8192 3 6 458 The Decoder 7289 4 7 136 Ugly Numb

6级英语作文范文

The Impact of the Internet on Interpersonal CommunicationAs is described in the picture, a father asks her daughter how her school today goes on. Instead of answering directly, the daughter tells her father to read her blog. It is common that youngst