题目:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should ...
分类:
其他好文 时间:
2014-06-27 11:55:43
阅读次数:
187
题目: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 sing...
分类:
其他好文 时间:
2014-06-27 11:38:12
阅读次数:
207
http://acm.hdu.edu.cn/showproblem.php?pid=1372以前真二,模板题OJ真奇怪,有时能A有时W,#include #include #include #include using namespace std;struct node{ int x,y,z;...
分类:
其他好文 时间:
2014-06-26 12:17:50
阅读次数:
161
做这个题的时候想到了,先来一遍最短路,判断是否可以到达,若可以减去最短路的花费,再在剩下的花费里进行DP求最优解,想到了但是没做到,很多细节没有处理好,结果崩盘了,唉,看题解很多人都是两边dfs,不过这位大牛也是先spfa了一遍, 给我这个弱菜看看 刚好,这篇好好记录下来,
最后参考了大牛的:http://blog.csdn.net/acm_cxlove/article/details...
分类:
其他好文 时间:
2014-06-26 07:07:46
阅读次数:
199
【题目】
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
OJ's undirected graph serialization:
Nodes are labeled uniquely.
We use # as a separator for each node, and , as a separator for node label and each ne...
分类:
其他好文 时间:
2014-06-26 06:48:16
阅读次数:
285
杭电OJ(HDU)-ACMSteps-Chapter Three-《FatMouse' Trade》《今年暑假不AC》《排名》《开门人和关门人》...
分类:
其他好文 时间:
2014-06-25 19:50:46
阅读次数:
227
今天在华为OJ上遇到这么一个题目,很简单,但是却总是得不到最好的成绩记录。因此比较了自己的程序、思路与别人的异同,发现还是有很大区别的,遂记录如下。
题目——
输入一个int型整数,求该整数的二进制在内存中有多少个1。例如输入10,由于其二进制表示为1010,有两个1,因此输出2。
思路1
public static void main(String[] args) {
...
分类:
其他好文 时间:
2014-06-25 07:56:23
阅读次数:
210
时间限制:1 秒
内存限制:128 兆
特殊判题:否
提交:1733
解决:656
题目描述:
如图,给定任意时刻,求时针和分针的夹角(劣弧所对应的角)。
输入:
输入包含多组测试数据,每组测试数据由一个按hh:mm表示的时刻组成。
输出:
对于每组测试数据,输出一个浮点数,代表时针和分针的夹角(劣...
分类:
其他好文 时间:
2014-06-25 00:32:54
阅读次数:
176
/*扑克牌游戏大家应该都比较熟悉了,一副牌由54张组成,含3~A、2各4张,小王1张,大王1张。牌面从小到大用如下字符和字符串表示(其中,小写joker表示小王,大写JOKER表示大王):
3 4 5 6 7 8 9 10 J Q K A 2 joker JOKER
输入两手牌,两手牌之间用"-"连接,每手牌的每张牌以空格分隔,"-"两边没有空格,如:4 4 4 4-joker JOKER。...
分类:
编程语言 时间:
2014-06-24 23:25:30
阅读次数:
517