摘要:
[ABC372D] Buildings 思路 正着做不方便,倒着用单调栈做一遍就行了。 代码 #include<iostream> using namespace std; inline int read(){register int x = 0, f = 1;register char c = g 阅读全文
摘要:
A - Pairing 思路 排个序,比较相邻元素。 代码 #include<iostream> #include<algorithm> using namespace std; inline int read(){register int x = 0, f = 1;register char c 阅读全文
摘要:
dream 首先朴素的 \(dp\) 很好想,前缀和优化也很简单,接下来考虑如何继续优化。 我们发现反转操作相当于把一个序列变成环反转后再移动几格,于是我们只需要知道 \(1\) 位置的变换就能知道其它位置数的变换。 #include<iostream> #define int long long 阅读全文