Description
As Cyy and Fzz are both busy repairing the network, Sama feel a little boring because it’s he who select Teemo during that game. Of cause his Teemo will stay alive since he has used the su...
分类:
其他好文 时间:
2015-04-20 15:02:15
阅读次数:
178
题目大意:给出n个正整数的序列,要求你找出符合sum(a1 + a2 + a3 + … + an) * min(a1,a2,…,an)的最大值,如果有多个符合条件的,输出最短序列解题思路:从输出中观察得到,输出的答案要有三个,最大值,左端点,右端点。
那就设两个数组,纪录已当前数位最小值所能覆盖的最大区间,然后枚举每个数,求出区间和再乘上当前数求得值再进行比较
设置左右区间时,可以递归比较,假设...
分类:
其他好文 时间:
2015-04-18 10:08:59
阅读次数:
100
XFCE stores it‘s configuration for the running session in?xfconfd. Feel free to back up the files you‘re going to delete first. Shut down the panel first,?xfce4-panel --quit Kill the xfce4 confi...
分类:
其他好文 时间:
2015-04-11 19:37:11
阅读次数:
180
1. Class, object and referenceRecall that class is nothing more than a blueprint that describes how an instance of this type will look and feel in mem...
分类:
其他好文 时间:
2015-04-11 16:08:23
阅读次数:
163
Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He reali...
分类:
其他好文 时间:
2015-04-02 09:12:26
阅读次数:
142
既然所有数都是大于等于0的,那么在一个区间最小值一定的情况下,这个区间越长越好(当然有特殊情况)
对一个数a[i],left[i]代表左边第一个比它小的,right[i]代表右边第一个比它小的
如何构造left[i]呢?,从左往右构造一个单调递增的栈(一定是单调的!)
当a[i]比栈顶元素小的时候,栈顶元素出栈,(否则的话入栈,left[i]就是栈顶元素的位置,right数组同理可得
注意...
分类:
其他好文 时间:
2015-04-01 17:54:19
阅读次数:
173
Spent time to write down C# program to implement an algorithm. Feel great! Start to practice, a question a time.Question is from careercup:http://www....
分类:
其他好文 时间:
2015-04-01 08:17:38
阅读次数:
225
1938. Message Flood
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
Well, how do you feel about mobile phone? Your answer would probably be something like that “It’s...
分类:
其他好文 时间:
2015-03-30 09:20:11
阅读次数:
106
Kinda similar with another palindrome DP from LeetCode. Feel it, it is a bottom-up DP - palindrome subsequence.str = input()slen = len(str)dp = [[0 fo...
分类:
其他好文 时间:
2015-03-20 06:45:44
阅读次数:
107