题目链接
题意: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
A so juicy and interesting problem! Recommend to everyone!A final solution may not jump into your mind immediately, of course, DP is not a trivial top...
分类:
其他好文 时间:
2014-08-10 15:37:00
阅读次数:
209
题目:
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Outpu...
分类:
其他好文 时间:
2014-08-10 13:08:30
阅读次数:
296
Given a collection of numbers, return all possible permutations.
For example,
[1,2,3] have the following permutations:
[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2],
and [3,2,1].
原题链接:https://oj...
分类:
其他好文 时间:
2014-08-10 10:25:50
阅读次数:
265
筛法是一种很快的方法,贴代码纪念一下。 做法很像筛法 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #...
分类:
其他好文 时间:
2014-08-10 10:19:50
阅读次数:
223