看数据规模,也懒得想了,裸DFS得了 1 import java.util.Scanner; 2 3 public class P1005 4 { 5 private static int best = Integer.MAX_VALUE; 6 7 //a[] 原始值 8 ...
分类:
其他好文 时间:
2014-08-26 01:41:55
阅读次数:
362
LeetCode: Best Time to Buy and Sell StockSay you have an array for which the ith element is the price of a given stock on day i.If you were only permi...
分类:
其他好文 时间:
2014-08-25 22:35:34
阅读次数:
261
1. ($15'$) 设 $A$ 是数域 $\bbP$ 上的 $r\times r$ 阶矩阵, $D$ 是 $s\times s$ 阶矩阵, $\dps{M=\sex{\ba{cc} A&B\\ C&D \ea}}$, 并且 $\rank(M)=\rank(A)=r$. 证明: $D=CA^{-1}...
分类:
其他好文 时间:
2014-08-25 22:27:14
阅读次数:
309
传说当中的best coder让我做确实感觉怪怪的,第一道wa了两发,你就知道我当时的
窘境了,哎,不提了。
就说第二题吧,我一开始是这样想的,从1到k-2全都赋值为各自的序列数,即1,2,3...
直到k-2, 然后算出前k-1项的和为beg, 前k-2项的和为beg2;
从beg开始,直到n循环,找到那个能完全开方的数 i,用n-i就是第k个数,i-...
分类:
其他好文 时间:
2014-08-25 17:06:14
阅读次数:
125
Best Time to Buy and Sell StockSay you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to compl...
分类:
其他好文 时间:
2014-08-25 16:52:04
阅读次数:
238
SELECT tmp.user_id, tmp.course_id, tmp.type, tmp.expire_time, @rownum := @rownum + 1,IF ( @course_id = tmp.course_id ,@rank := @rank + 1, @rank := 1) ...
分类:
数据库 时间:
2014-08-25 11:41:34
阅读次数:
275
5 life lessons you will learn the hard way五条垂暮之年才明白的道理Life is not easy when you are pursuing something worthwhile and ready to learn from the best exp...
分类:
其他好文 时间:
2014-08-25 11:31:04
阅读次数:
275
一个线段树问题节点记录这样几个值,sum(这个区间的总和),best(这个区间中的最大值),lazy(翻倍的lazy标记)这里的[a,b]区间代表数为a与b之间的那些东西,因为无论怎么弄这些相同数字的都是连续的 1 #include 2 #include 3 #include 4 #i...
分类:
其他好文 时间:
2014-08-25 11:28:34
阅读次数:
242
The best way to predict your future is to create it预测未来的最好方式就是去创造它The best way to predict you future is to create it预测未来的最好方式就是去创造它The best way to pre...
分类:
其他好文 时间:
2014-08-25 08:44:03
阅读次数:
203
最近在研究HTML5 boilerplate的模版,以此为线索可以有条理地学习一些前端的best practice,好过在W3C的文档汪洋里大海捞针……啊哈哈哈……开头的IE探测与no-js类是什么?Modernizer探测到浏览器启用了js的时候会将.no-js替换成.js,这样在CSS里可以为禁...
分类:
Web程序 时间:
2014-08-24 22:12:13
阅读次数:
258