#Hair

Bad Hair Day

BadHairDay我的第一道单调栈题目,知道单调栈(点这里)的思想,思路还是比较好想的;AC_Code:1#include<iostream>2#include<cstdio>3#include<iomanip>4#include<stack>5usingnamespa...
代码星球 ·2020-12-28

POJ 3250 Bad Hair Day 单调栈

维护一个单调递减的栈每次家进栈首的牛必然能够被其它栈里面的牛看到#include<cstdio>#include<cstring>usingnamespacestd;constintmaxn=80010;typedefunsignedlonglongLL;inta[maxn],s[maxn];i...
代码星球 ·2020-04-06