Given a sorted linked list, delete all nodes
that have duplicate numbers, leaving onlydistinctnumbers from the original
list.For example,Given1->2->3-...
分类:
其他好文 时间:
2014-05-07 13:42:51
阅读次数:
278
Problem:Work out the first ten digits of the
sum of the following one-hundred 50-digit
numbers.3710728753390210279879799822083759024651013574025046376...
分类:
其他好文 时间:
2014-05-07 13:34:38
阅读次数:
299
The Little Elephant likes permutations. This time he has a permutation A[1], A[2], ..., A[N] of numbers 1, 2, ...,N.
He calls a permutation A good, if the number of its inversions is equal to the n...
分类:
其他好文 时间:
2014-05-07 07:20:50
阅读次数:
356
[Question]
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to t...
分类:
其他好文 时间:
2014-05-07 05:37:44
阅读次数:
278
题目链接: SCUT 2014
题目大意: 判断给出的字符串中是否是正确的科学计数法
A+1.5Be+8C,可以是实数或者含有指数的实数,ABC三个部分表示空格,可有可无,正负号可有可无
指数部分只能是整数
解题思路: 建立有穷自动机状态转移表,一共是10种状态...
分类:
其他好文 时间:
2014-05-07 05:32:27
阅读次数:
330
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4722
思路:数位dp,dp[i][j]表示到第i位,数字和%10为j,然后进行dp,注意完全匹配的情况是要+1,而其他情况是从0 到 9 都要考虑
代码:
#include
#include
#include
#include
using namespace std;
int t;
l...
分类:
其他好文 时间:
2014-05-07 04:55:37
阅读次数:
314
Subtraction Game 1
Chef is playing a game on a sequence of N positive integers, say A1, A2, ... AN. The game is played as follows.
If all the numbers are equal, the game ends.Otherwise
Sele...
分类:
其他好文 时间:
2014-05-07 03:14:01
阅读次数:
280
Given a triangle, find the minimum path sum
from top to bottom. Each step you may move to adjacent numbers on the row
below.For example, given the fol...
分类:
其他好文 时间:
2014-05-07 02:55:24
阅读次数:
377
Problem:The sequence of triangle numbers is
generated by adding the natural numbers. So the 7thtriangle number would be 1 +
2 + 3 + 4 + 5 + 6 + 7 = 28...
分类:
其他好文 时间:
2014-05-07 00:28:01
阅读次数:
365
题目链接:
http://acm.hdu.edu.cn/showproblem.php?pid=4135
Co-prime
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1176 Accepted Submis...
分类:
其他好文 时间:
2014-05-06 22:11:57
阅读次数:
407