既然所有数都是大于等于0的,那么在一个区间最小值一定的情况下,这个区间越长越好(当然有特殊情况)
对一个数a[i],left[i]代表左边第一个比它小的,right[i]代表右边第一个比它小的
如何构造left[i]呢?,从左往右构造一个单调递增的栈(一定是单调的!)
当a[i]比栈顶元素小的时候,栈顶元素出栈,(否则的话入栈,left[i]就是栈顶元素的位置,right数组同理可得
注意...
分类:
其他好文 时间:
2015-04-01 17:54:19
阅读次数:
173
相关链接: http://www.educity.cn/wenda/396240.html //good
分类:
数据库 时间:
2015-04-01 01:38:23
阅读次数:
149
Long time no blog.I worked on Interspeech 2015, but failed. The classification accuracy is not as good as excepted. I will change the lower BLSTM laye...
分类:
其他好文 时间:
2015-04-01 00:20:29
阅读次数:
125
Library naming--------------Because the library is being built using various exceptionhandling schemes and compilers - and because the librarymay not ...
分类:
其他好文 时间:
2015-03-31 14:33:50
阅读次数:
132
原文链接可能失效。This post is old but will remain on the front page for the time being.140313. Jeff Jenkins posted these questions and others recently atAsk H...
分类:
移动开发 时间:
2015-03-31 10:29:05
阅读次数:
181
一直都很喜欢cf,从大一下开始, 想想现在已经差不多过了一年了吧,这一年里,真心为自己的成长感到高兴,“人弱被人欺”, 去年上次在广州地区赛时深深感受到。B. Pasha and String 1 /***Good Luck***/ 2 #define _CRT_SECURE_NO_WARNINGS...
分类:
其他好文 时间:
2015-03-31 06:25:57
阅读次数:
197
A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message conta...
分类:
其他好文 时间:
2015-03-30 20:29:37
阅读次数:
111
Good subsequenceProblem's Link: http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1553Mean:给你一个长度为n的序列和一个值k,让你找出一个子序列,满足在这个子序列中max-min的值#include#includ...
分类:
其他好文 时间:
2015-03-30 18:05:09
阅读次数:
100
4313. Boys and Girls
Constraints
Time Limit: 1 secs, Memory Limit: 256 MB
Description
There
are N boys and N girls
at a dance party. We have measured their heights. Each boy will...
分类:
其他好文 时间:
2015-03-30 09:18:35
阅读次数:
112
http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2071&pid=6题意:有一个由n个数组成的序列 要求出一个满足 max-min#include#include#include#include#include#include#include...
分类:
其他好文 时间:
2015-03-30 01:11:45
阅读次数:
132