- 博客(3)
- 收藏
- 关注
原创 BZOJ3028 食物 (生成函数)
由题意,生成函数 gn(x)g^n(x)gn(x) 为下列各式的乘积 汉堡:(1+x2+x4+...)=1/(1−x2)(1 + x^2 + x^4 + ...) = 1 / (1 - x^2)(1+x2+x4+...)=1/(1−x2) 可乐:(1+x)=(1−x2)/(1−x)(1 + x) = (1 - x^2) / (1 - x)(1+x)=(1−x2)/(1−x) 鸡腿:(1+x+x2)=(1−x3)/(1−x)(1 + x + x^2) = (1 - x^3) / (1 - x)(1+x+x2)
2021-02-23 21:55:35 81
原创 CF679 D Shurikens (Stack)
CF679 D Shurikens (Stack) 栈 + 模拟,巧妙的限制标记 Code #include <iostream> #include <algorithm> using namespace std; const int N = 1e5 + 5; int s[N], num[N], ord[N]; char str[N][5]; int main() { int n, top = 0, pos = 0, bad = 0; cin >> n; f
2020-10-28 11:51:14 151
原创 CF679 C Perform Easily (双指针)
Codeforces Round #679 C Perform Easily (双指针) 用map查询,时间复杂度 O(nmlog(nm))O(nmlog(nm))O(nmlog(nm)) Code #include <iostream> #include <algorithm> #include <map> using namespace std; const int N = 6e6 + 5; pair<int, int> p[N]; int a[10
2020-10-28 11:46:41 383
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人