这几天的知识学习比较多,因为时间不够了.加油吧,为了梦想. 这里写几条简单的单调栈作为题解记录,因为单调栈的用法很简单,可是想到并转化成用这个需要一些题目的积淀. 相关博客参见:https://blog.csdn.net/wubaizhe/article/details/70136174 POJ 3250 Bad Hair Day 题意与分析 题意是这样的:\(n\)个牛排成一列向右看,牛\(i\)能看到牛\(j\)的头顶,当且仅当牛\(j\)在牛\(i\)的右边并且牛\(i\)与牛\(j\)之…
COT2 - Count on a tree II #tree You are given a tree with N nodes. The tree nodes are numbered from 1 to N. Each node has an integer weight. We will ask you to perform the following operation: u v : ask for how many different integers that represent…
COT2 - Count on a tree II You are given a tree with N nodes. The tree nodes are numbered from 1 to N. Each node has an integer weight. We will ask you to perform the following operation: u v : ask for how many different integers that represent the we…