Query
Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 2595 Accepted Submission(s): 860
Problem Description
You are given two s...
分类:
其他好文 时间:
2014-08-25 21:12:44
阅读次数:
281
Description
Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication,
exponenti...
分类:
其他好文 时间:
2014-08-25 21:11:14
阅读次数:
183
Description
Given a base b and two non-negative base b integers p and m, compute p mod m and print the result as a base b integer. p mod m is defined as the smallest non-negative integer k such tha...
分类:
编程语言 时间:
2014-08-25 19:20:04
阅读次数:
230
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.思路: 1 cla...
分类:
其他好文 时间:
2014-08-25 18:38:04
阅读次数:
211
Description
Problem C
Polynomial GCD
Input: standard input
Output: standard output
Given two polynomials f(x) and g(x) in
Zn, you have to find their GCD polynomial, ie, a polynomial
r(x)...
分类:
其他好文 时间:
2014-08-25 17:09:34
阅读次数:
209
Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".思路: 1 class Solution { 2 public: 3 strin...
分类:
其他好文 时间:
2014-08-25 16:58:34
阅读次数:
188
Goffi and Median
Problem Description
A median in a sequence with the length of n is an element which occupies position number ?n+12? after we sort the elements in the non-decreasing order ...
分类:
其他好文 时间:
2014-08-25 11:55:34
阅读次数:
159
Now a days a very common problem is:“The coordinate of two points in Cartesian coordinate system is (200, 300) and(4000, 5000). If these two points are connected we get a line segment. How manylattice...
分类:
其他好文 时间:
2014-08-24 23:54:33
阅读次数:
406
HDU 4981 Goffi and Median
思路:排序就可以得到中间数,然后总和和中间数*n比较一下即可
代码:
#include
#include
#include
#include
using namespace std;
const int N = 1005;
int n, a[N], sum;
int main() {
while (~sca...
分类:
其他好文 时间:
2014-08-24 23:54:23
阅读次数:
288
N-Queens
Total Accepted: 12866 Total
Submissions: 49759My Submissions
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens
attack each oth...
分类:
其他好文 时间:
2014-08-24 22:21:03
阅读次数:
166