作者: starry

69 篇文章

区间最值板子
struct BIT { LL h[(int)1e5 + 9], n; void init(int x) { n = x; f(i,1,n)update(i); } void update(int x) { while(x<=n){ h[x]=aa[x]; int low=lowbit(x); for(int i=1;…
CF1728D
考虑对于区间 [l,r], Bob 是否可以达成平手。 如果 Alice 取 l,Bob 取 r 并且有 s[l]=s[r],那么区间就转移到了 [l+1,r1] 上。相反的,如果 Alice 取 r,那么 Bob 可以取 l,也是同上的。 如果 Alice 取 l,Bob 取 l+1 并且有 s[l]=s[l+1],那么区间就转移到 [l+2,r] 上…
一觉醒来unrated
英语不好被题面搞了老半天,:) 不过 unrated 了,好事!
Codeforces Round #817 (Div. 4)
还好光荣下班?A: #include <bits/stdc++.h> /* #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/hash_policy.hpp> */using namespace std; const double eps =…
斯特林数
第一类斯特林数 [nk]=[n1k1]+(n1)[n1k] 下降幂转普通幂:xn=i=0n(1)ni[ni]xi 上升幂转普通幂:$$x^{\overline {n}} = \sum\l…
反演
反演:求逆映射的过程 二项式反演 (x+1)n=i=0n(ni)xixn=i=0n(1)ni(ni)(x+1)i
ec final游记
今晚看见 ec 上 gym 了,也是时候写写游记了 E. Prof. Pang and Poker 开场有人开了 A 和 I,队友读完 I 后觉得可做,我看榜后去弄 A。 然后队友 I 写出了些问题,我上机写 A,此时评测机繁忙,后面显示 correct 过了,罪恶 - 1 然后队友讨论完 I 后也过了,接下来我看完 L 也上机写,但是写着写着写挂了(此时理解错题意,1 不代表是正数而应该是…
AOJ  CGL_1_A
求点在直线上的投影坐标,考虑定比分点的性质做,注意特判边界条件 #include <cstdio> #include <cmath> using namespace std; double xx1, x2, yy1, y2, xx0, yy0; int q; int main () { scanf ("% lf% lf% lf% lf", &…