码迷,mamicode.com
首页 >  
搜索关键字:two sum    ( 31846个结果
[记忆化搜索] zoj 3681 E - Cup 2
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3681 E - Cup 2 Time Limit: 2 Seconds      Memory Limit: 65536 KB The European Cup final is coming. The past two World C...
分类:其他好文   时间:2014-05-15 14:56:27    阅读次数:393
Multi-Thread 1: how to use synchronized
1. synchronized If two threads are using the same function( here we use output to print out string) of another instance, if we want to make sure that these two threads are not disturbing each other. ...
分类:其他好文   时间:2014-05-15 11:14:14    阅读次数:389
Hive常用命令
创建表: hive> CREATE TABLE pokes (foo INT, bar STRING);          Creates a table called pokes with two columns, the first being an integer and the other a string 创建一个新表,结构与其他一样 hive> create table n...
分类:其他好文   时间:2014-05-15 07:07:58    阅读次数:303
HDU 4059 The Boss on Mars-矩阵+容斥
错了29遍,终成正果。。。。。 根据题意,很容易的可以想到容斥。 然后的问题就是如何求 sum(n)=1^4+2^4+3^4+....+n^4; 有三种道路: 很显然:1^4+2^4+3^4+....+n^4=(n^5)/5+(n^4)/2+(n^3)/3-n/30; 则1,用java的大数去敲这个的代码。 2,用c++敲,但是用到分数取模,求逆元。 3,用c++敲,但是不用这...
分类:其他好文   时间:2014-05-15 06:36:06    阅读次数:328
[LeetCode] K sum(2Sum、3Sum、4Sum)
2Sum & 3Sum & 4Sum & KSum...
分类:其他好文   时间:2014-05-15 05:33:56    阅读次数:270
LeetCode-004 Add Two Numbers
【题目】 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 single digit. Add the two numbers and return it as a linked list. Input: (2 -> 4 -> 3) + (5 -> 6 -> 4) Out...
分类:其他好文   时间:2014-05-15 05:13:49    阅读次数:306
leetcode第一刷_Combination Sum Combination Sum II
啊啊啊啊,好怀念这种用递归保存路径然后打印出来的题目啊,好久没遇到了。 分了两种,一种是可以重复使用数组中数字的,一种是每个数字只能用一次的。其实没有多大区别,第一种每次进入递归的时候都要从头开始尝试,第二种要找一个标记的数组,把已经用到过的排除掉,就像生成全排列时的做法一样。跟我一样用引用保存中间结果的话,要注意回退的情况。第二种回退时,要把用到的那个数也恢复为可用,就完全像全排列时做的一样。...
分类:其他好文   时间:2014-05-15 04:46:34    阅读次数:272
leetCode-002 Median of Two Sorted Arrays
leetCode-002 Median of Two Sorted Arrays 【题目】 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 be O(log (m+n)). 【题意】 有两个有序的数组,找出这两数组整合后的中位数,要求时间复杂度O(nlogn)...
分类:其他好文   时间:2014-05-15 04:42:05    阅读次数:274
UVALive 6609(Minimal Subarray Length)维护递增序列|RMQ
题意:给一个整数序列(可能有负数),求最短的连续序列使得序列之和大于等于整数x; 解法:第一种是On的复杂度:                   我们要的是sum[j]-sum[i]>=x,如果有两个决策j = sum[j'],那么j就是没用的。即维护一个sum[j]递增序列。然后每次可以二分查找,但是这里有个特点就是要得到最近的,可以同时维护一个left指针,left指针用于跟进更...
分类:其他好文   时间:2014-05-15 03:20:26    阅读次数:303
JSP_include指令和<jsp:include>
包含三个文件:jsp_include.jsp, static.html, two.jsp 环境:tomcat7.0, myeclipse10 1.jsp_include.jsp goto two--> this examples show include works '/> '/> 2.static.html...
分类:Web程序   时间:2014-05-14 14:27:53    阅读次数:334
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!