CF547E Mike and Friends】的更多相关文章

裸题,敲完后没调就过了 ~ code: #include <bits/stdc++.h> using namespace std; #define ll long long #define lson t[x].ls #define rson t[x].rs #define setIO(s) freopen(s".in","r",stdin) const int N=200006; char str[N]; int tax[N<<1],rk[N…
子串看起来就很SuffixStructures 于是上SAM 本来想着直接LCT 后来发现没法串定位(暴力匹配复杂度不对) 然后就离线吧,先建出来然后链加子树和,树剖就odk. 其实更直接的套路是线段树合并right集合维护. 这个题很像BZOJ3881 那个题更复杂一点,需要树链的并(到时候看看这个题可不可以加强一下扔到校内模拟赛 当然还有正确的ACA写法,直接FAIL树上主席树.(就更像BZOJ3881了 (但感觉都很暴力,我的想法貌似还挺好的) 顺便学习了广义SAM的正确写法.(发现之前的…
#include <cstdio> #include <queue> #include <vector> #define pb emplace_back using namespace std; int read() { int x = 0; char c = getchar(); while (c < 48) c = getchar(); while (c > 47) x = x * 10 + (c - 48), c = getchar(); return…
C. Mike and Foam time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike is a bartender at Rico's bar. At Rico's, they put beer glasses in a special shelf. There are n kinds of beer at Rico's…
D. Mike and Feet time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Mike is the president of country What-The-Fatherland. There are n bears living in this country besides Mike. All of them are…
C. Mike and Frog time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Mike has a frog and a flower. His frog is named Xaniar and his flower is named Abol. Initially(at time 0), height of Xaniar…
原题: Description Mike wants to prepare for IMO but he doesn't know geometry, so his teacher gave him an interesting geometry problem. Let's define f([l, r]) = r - l + 1 to be the number of integer points in the segment [l, r] with l ≤ r (say that ). Y…
原题: Description While swimming at the beach, Mike has accidentally dropped his cellphone into the water. There was no worry as he bought a cheap replacement phone with an old-fashioned keyboard. The keyboard has only ten digital equal-sized keys, loc…
原题: Description Recently, Mike was very busy with studying for exams and contests. Now he is going to chill a bit by doing some sight seeing in the city. City consists of n intersections numbered from 1 to n. Mike starts walking from his house locate…
原题: Description Bad news came to Mike's village, some thieves stole a bunch of chocolates from the local factory! Horrible! Aside from loving sweet things, thieves from this area are known to be very greedy. So after a thief takes his number of choco…