A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message con...
分类:
其他好文 时间:
2014-08-13 12:38:26
阅读次数:
225
Problem Description
Let's play a card game called Gap.
You have 28 cards labeled with two-digit numbers. The first digit (from 1 to 4) represents the suit of the card, and the second digit (from 1 ...
分类:
其他好文 时间:
2014-08-12 10:24:14
阅读次数:
379
题意 所有只能被2,3,5,7这4个素数整除的数称为Humble Number 输入n 输出第n个Humble Number
1是第一个humble number 对于一个Humble Number a 有2*a,3*a,5*a,7*a都是Humble Number 可以以1为基数 依次展开即可得到一定范围内的Humble Number 用i,j,k,l分别记录 2,3,5,7分别乘到了第几个Humble Number 当前在计算第cnt个Humble Number 那么有 hum[c...
分类:
其他好文 时间:
2014-08-12 10:20:23
阅读次数:
202
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example, [1,1,2] have the following unique pe...
分类:
其他好文 时间:
2014-08-12 10:17:03
阅读次数:
142
题目链接
题意:s1/s2=N,s1、s2、N都是各个位数上数字不相同的整数。给定N,求有多少个这样的式子并输出。
思路:其实最大的数只能是9876543210,所以我们只要暴力枚举,枚举过程中判断s1、s2是否符合题目要求。
#include
#include
#include
#include
#include
using namespace std;...
分类:
其他好文 时间:
2014-08-11 21:21:33
阅读次数:
290
Where is the Marble?
Raju and Meena love to play with Marbles. They have got a lot of marbles with numbers written on them. At the beginning, Raju would place the marbles one after ano...
分类:
其他好文 时间:
2014-08-11 17:53:02
阅读次数:
291
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have
the following unique permutations:
[1,1,2], [1,2,1],
and [2,1...
分类:
其他好文 时间:
2014-08-11 17:49:32
阅读次数:
201
f (0) = 0 and f (1) = 1f (i+2) = f (i+1) + f (i) for every i ≥ 0
Sample input
three integers a,b,n where
0 ≤ a,b 64 (a and b will
not both be zero) and 1 ≤ n ≤ 1000.
T
a b n
...
分类:
其他好文 时间:
2014-08-11 12:02:42
阅读次数:
220
Problem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of...
分类:
其他好文 时间:
2014-08-11 11:52:02
阅读次数:
197
Consider integer numbers from 1 to n. Let us call the sum of digits of an integer number its weight. Denote the weight of the number x as w(x).
Now let us order the numbers using so called graduated ...
分类:
其他好文 时间:
2014-08-10 18:47:20
阅读次数:
406