BZOJ2795 A Horrible Poem
今天上课讲的题。 做法就直接枚举约数,或者说分解质因数。后者可以预处理到log。 判循环也比较开心。直接用一些奇奇怪怪的字符串的性质就好了。 看来字符串很博大精深啊。 #include <cstdio> #include <cctype> #include <cstring> #include <algorithm> using namespace std; typedef unsigned long long qw; typedef pair <int, qw> hstrv; #define _l (long long int) int _d_; #define readInt(_x_) { \ int& _s_ = _x_; \ while (!isdigit(_d_ = getchar())); \ _s_ = 0; \ while ((_s_ = _s_ * 10 + _d_ - 48), isdigit(_d_ = getchar())); \ } const int maxn = 500009; const int base = 257; const int hmod = 1000000093;...