Description
In the late 1700s', Gauss, a famous mathematician, found a special kind of numbers. These integers are all in the form:
a + b .The sum and multiplication ofthese integers can be natura...
分类:
其他好文 时间:
2014-08-26 11:46:25
阅读次数:
237
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define inf 0x3f3f3f3f
#pragma comment(linker, "/STACK:16777216")
#define eps 1e-6
#define ll long l...
分类:
其他好文 时间:
2014-08-25 22:59:45
阅读次数:
524
LeetCode: TriangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For exa...
分类:
其他好文 时间:
2014-08-25 22:48:14
阅读次数:
306
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl...
分类:
其他好文 时间:
2014-08-25 22:43:04
阅读次数:
266
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.N...
分类:
其他好文 时间:
2014-08-25 20:41:44
阅读次数:
192
http://acm.timus.ru/problem.aspx?space=1&num=1586
题意没看懂,看了别人的翻译。threeprime number的意思是任意三个连续的数组成的一个三位数是素数,注意必须是三位数。给出n,问满足条件的n位数有多少个。
先把三位数的素数筛选出来并标记,设dp[i][j][k]表示到i位为止,最后两位是j和k的满足条件的数的个数。
...
分类:
其他好文 时间:
2014-08-25 19:15:44
阅读次数:
161
这是题目的答案#include#includeusing namespace std;int a[45002];int b[45002];int mod(int a, int b, int c){ int z = 1; while(b) { if(b%2) ...
分类:
其他好文 时间:
2014-08-25 13:20:14
阅读次数:
132
题目链接The problem is quite simple. You're given a number N and a positive integer K. Tell if N can be represented as a sum of K prime numbers (not neces...
分类:
其他好文 时间:
2014-08-25 13:19:04
阅读次数:
270
Problem 34
145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.
Find the sum of all numbers which are equal to the sum of the factorial of their digits.
Note: as 1! = 1 and 2! = 2 are...
分类:
其他好文 时间:
2014-08-25 11:59:14
阅读次数:
243
Problem 36
The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.
Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.
(Please...
分类:
其他好文 时间:
2014-08-25 10:06:04
阅读次数:
198