BZOJ2351/2462 [BeiJing2011]Matrix
好像要用二维AC自动机的样子!?不对,还要优化不然还会MLE!? naive。 哈希水过之。 中途某处忘强转导致调了良久。 2462丧心病狂卡stl常数,差点写平衡树了,然后想了想二分水之。 #include <cstdio> #include <cstring> #include <set> #include <algorithm> using namespace std; typedef long long qw; typedef unsigned long long uqw; #define _l (qw) const int rmod = 345379; const int b1 = 3; const int b2 = 3153131; const int maxn = 1009; int pb1[maxn]; int n, m, x, y, q, hr[maxn][maxn], t; uqw hl[maxn][maxn], pb2[maxn]; char g[maxn]; uqw th[maxn * maxn]; void pre() { pb1[0] = 1; pb2[0] = 1;...