07 2018 档案
摘要:Problem A. Ascending Rating 先学习一下单调队列与单调栈,其实和STL的也没啥区别,就是手动维护数组。 POJ 2823 #include <cstdio> #include <algorithm> using namespace std; const int maxn =
阅读全文
摘要:CodeForces 628E CodeForces 617E CodeForces 618E CodeForces 620E dfs序+线段树+set存颜色T了。 我竟然没想到可以用long long来存颜色,这次吸取教训了。 #include <bits/stdc++.h> using name
阅读全文
摘要:1.多重集的组合数 这里问题一般的描述为: 算法竞赛进阶指南上有详细的推导。 例题1: CF 451E Devu and Flowers 直接带公式,但本题 m 太大,先用Lucas对m取模,再转换成排列再乘以逆元就可以了。 #include <bits/stdc++.h> using namesp
阅读全文
摘要:1007 Naive Operations 还是写的有点冗余。 ai / bi ,ai从0开始增,转换成bi一直减,减到0就说明除法商+1。这样就维护区间最小值,最小值 == 0就说明 +1。这还有个调和级数的概念。 #include <iostream> #include <algorithm>
阅读全文