Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor...
分类:
其他好文 时间:
2015-08-12 23:10:02
阅读次数:
92
DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj.For a given sequence of ....
分类:
其他好文 时间:
2015-08-11 18:05:38
阅读次数:
104
1. Problem给定n对括号,生成所有可能的括号组合Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given ...
分类:
其他好文 时间:
2015-08-10 21:47:01
阅读次数:
100
题目Given a linked list, swap every two adjacent nodes and return its head.For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You may...
分类:
其他好文 时间:
2015-08-10 20:06:13
阅读次数:
117
Minimum Inversion NumberProblem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisf...
分类:
其他好文 时间:
2015-08-09 18:23:51
阅读次数:
119
hdu 1394 的传送门Problem Description
The inversion number of a given number sequence a1, a2, …, an is the number of pairs (ai, aj) that satisfy i aj.For a given sequence of numbers a1, a2, …,...
分类:
其他好文 时间:
2015-08-08 12:10:17
阅读次数:
130
题意 给你一个数n 求满足lcm(a, b) == n, a
容易知道 n 是a, b的所有素因子取在a, b中较大指数的积
先将n分解为素数指数积的形式 n = π(pi^ei) 那么对于每个素因子pi pi在a,b中的指数ai, bi 至少有一个等于pi, 另一个小于等于pi
先不考虑a, b的大小 对于每个素因子pi
1. 在a中的指数 ai == ei 那么 ...
分类:
其他好文 时间:
2015-08-07 09:36:35
阅读次数:
151
DescriptionWrite a program that finds and displays all pairs of 5-digit numbers that between them use the digits 0 through 9 once each, such that the ...
分类:
其他好文 时间:
2015-08-02 21:20:10
阅读次数:
235
原题:DescriptionWrite a program that finds and displays all pairs of 5-digit numbers that between them use the digits0through9once each, such that the f...
分类:
其他好文 时间:
2015-08-02 19:42:48
阅读次数:
301
Description:Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits0through9once each, such that the fir...
分类:
其他好文 时间:
2015-08-02 16:27:59
阅读次数:
160