Problem Description
Arthur and his sister Caroll have been playing a game called Nim for some time now. Nim is played as follows:
The starting position has a number of heaps, all containing some, not necessarily equal, number of beads.
The players t...
分类:
其他好文 时间:
2015-02-26 23:05:36
阅读次数:
422
Problem Description
Let A1, A2, … , AN be N elements. You need to deal with two kinds of operations. One type of operation is to add a given number to a few numbers in a given interval. The other is t...
分类:
其他好文 时间:
2015-02-26 21:40:35
阅读次数:
246
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2015-02-26 21:32:39
阅读次数:
152
http://acm.hdu.edu.cn/showproblem.php?pid=4635
Problem Description
Give a simple directed graph with N nodes and M edges. Please tell me the maximum number of the edges you can add that the gr...
分类:
其他好文 时间:
2015-02-26 18:35:11
阅读次数:
148
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without u...
分类:
其他好文 时间:
2015-02-26 18:33:18
阅读次数:
99
Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have the fol...
分类:
其他好文 时间:
2015-02-26 18:10:39
阅读次数:
137
packagexian;importjava.util.concurrent.ExecutorService;importjava.util.concurrent.Executors;importorg.apache.commons.httpclient.HttpClient;importorg.apache.commons.httpclient.HttpStatus;importorg.apache.commons.httpclient.methods.GetMethod;publicclassRefres..
分类:
其他好文 时间:
2015-02-26 16:48:15
阅读次数:
224
1 CREATE OR REPLACE FUNCTION GETGYS(NUM1 NUMBER, NUM2 NUMBER) RETURN NUMBER IS 2 RESULTNUM NUMBER; 3 NUM3 NUMBER; 4 MINNUM NUMBER; 5 BE...
分类:
数据库 时间:
2015-02-26 16:30:11
阅读次数:
334
Problem Description
For a decimal number x with n digits (AnAn-1An-2 … A2A1), we define its weight as F(x) = An * 2n-1 + An-1 * 2n-2 + … + A2 * 2 + A1 * 1. Now you are given two numbers A and B, pleas...
分类:
其他好文 时间:
2015-02-26 14:57:25
阅读次数:
102
Merge用来从一个表中选择一些数据更新或者插入到另一个表中。而最终是用更新还是用插入的方式取决于该语句中的条件。下面我们简单的举一个例子: SQL> create table merge_test1(a number,b varchar2(20))表已创建。SQL> create table me...
分类:
数据库 时间:
2015-02-26 11:35:52
阅读次数:
204