题目描述:输入一个递增排序的数组和一个数字S,在数组中查找两个数,是的他们的和正好是S,如果有多对数字的和等于S,输出两个数的乘积最小的。
输入:
每个测试案例包括两行:
第一行包含一个整数n和k,n表示数组中的元素个数,k表示两数之和。其中1
第二行包含n个整数,每个数组均为int类型。
输出:对应每个测试案例,输出两个数,小的先输出。如果找不到,则输出“-1 -1”...
分类:
其他好文 时间:
2014-11-07 23:33:44
阅读次数:
425
问题描述:
Follow up for "Unique Paths":
Now consider if some obstacles are added to the grids. How many unique paths would there be?
An obstacle and empty space is marked as 1 and
0 respectively in ...
分类:
其他好文 时间:
2014-11-07 20:56:34
阅读次数:
272
Dataload常用命令
Dataload命令符
说明
Tab 或\{tab}
键盘Tab键,下一个单元
*UP 或\{UP}
键盘上
*DN 或\{DOWN}
键盘下
*LT 或\{LEFT}
键盘左
*RT 或\{RIGH...
分类:
其他好文 时间:
2014-11-07 20:55:12
阅读次数:
2773
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the...
分类:
其他好文 时间:
2014-11-07 19:10:51
阅读次数:
161
Getting Office License Configuration Information.---------------------------------------Backing Up License Info In Case Of Failure.-------------------...
分类:
其他好文 时间:
2014-11-07 18:30:05
阅读次数:
231
Find Minimum in Rotated Sorted Array IIFollow up for "Find Minimum in Rotated Sorted Array": What if duplicates are allowed?Would this affect the run-...
分类:
其他好文 时间:
2014-11-07 16:47:41
阅读次数:
233
http://blog.csdn.net/yuhua3272004/article/details/3075436使用java.math.BigDecimal工具类实现java保留两位小数问题:方式一(四舍五入形式保留两位小数,注意模式ROUND_HALF_UP):四舍五入double f = 11...
分类:
编程语言 时间:
2014-11-07 12:49:25
阅读次数:
1997
When it comes to Hadoop distributions, enterprises care about a number of things. Among them are high performance, high availability, and API compatibility. MapR, a San Jose, Calif.-based start-up,...
分类:
其他好文 时间:
2014-11-07 11:29:06
阅读次数:
135
以前做过,碰巧看到了。我去复制了一下。很奇怪……交POJ的程序交HDU 就WA。
然后重写,交HDU的程序AC后再去交 POJ 居然TLE。简直……
简单DFS,判重就好了。
HDU :
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#inc...
分类:
其他好文 时间:
2014-11-07 09:52:29
阅读次数:
234
题目中给出的代码如下:def break_words(stuff): """This function will break up words for us.""" words = stuff.split(' ') return wordsdef sort_words(word...
分类:
其他好文 时间:
2014-11-06 23:24:25
阅读次数:
271