Mike and Feet(CF 547B)】的更多相关文章

Mike and Feet time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Mike is the president of country What-The-Fatherland. There are n bears living in this country besides Mike. All of them are st…
题意 n个值代表n个熊的高度 对于size为x的group strength值为这个group(连续的几个熊)中熊的最小的height值 对于x(1<=x<=n) 求出最大的strength值 http://codeforces.com/contest/548/problem/D 思路 我们把每个数作为最小值能最远向左和右用单调栈处理出来,那么可以发现对于x长度的所有group,某个数延伸的区间长度如果大于等于x,则这个数对答案有贡献. 对于样例,我们处理出来后可以观察发现确有此规律: 然后就…
Mike and Feet time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Mike is the president of country What-The-Fatherland. There are n bears living in this country besides Mike. All of them are st…
题意 (Codeforces 548D) 对一个有$n$个数的数列,我们要求其连续$x(1\le x\le n)$(对于每个$x$,这样的连续group有若干个)的最小数的最大值. 分析 这是一道用了单调栈的题目,用的贼好.算是第一次应用吧. 我们定义$l_i$为左侧比第$i$个数小的数的下标的最大值(没有就是0):$r_i$就是右侧比第$i$个数小的数的下标的最小值(没有就是$n+1$).这样定义完后,我们会发现,$a_i$是$[a_{l_i+1},a_{r_i-1}]$的最小值,也就是siz…
题目链接:http://codeforces.com/problemset/problem/548/D 给你n个数,对于(1,n)长度,让你找到线段的最小值的最大值是多少 #include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<algorithm> #define N 200050 #define INF 1e16 #define met(a,…
题目链接:http://codeforces.com/problemset/problem/548/B 有一个n*m的矩阵,里面只有0和1,现在有Q个改变,每次都把(x,y)这点变为相反的点(0变1,1变0),每次改变后求所有行中最多有多少个连续的1: #include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<algorithm> #define…
题目:http://codeforces.com/contest/809/problem/E…
http://codeforces.com/problemset/problem/670/D2 The term of this problem is the same as the previous one, the only exception — increased restrictions. Input The first line contains two positive integers n and k (1 ≤ n ≤ 100 000, 1 ≤ k ≤ 109) — the nu…
http://codeforces.com/contest/659/problem/D     Maria participates in a bicycle race. The speedway takes place on the shores of Lake Lucerne, just repeating its contour. As you know, the lake shore consists only of straight sections, directed to the…
lazy区间修改   : http://acm.hdu.edu.cn/showproblem.php?pid=4902   (hdu4902) http://acm.hdu.edu.cn/showproblem.php?pid=4893 (hdu4902) http://codeforces.com/contest/447/problem/E     (Codeforces Round #FF (Div. 2) E)) http://codeforces.com/contest/121/prob…