1.2k1 分钟

#include <bits/stdc++.h> /* #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/hash_policy.hpp> */ using namespace std; const double eps = 1e-10; const double pi = 3.1415926535897932384626433832795; const double eln = 2.718
2.3k2 分钟

卡时间过了 ^_^ #include <bits/stdc++.h> using namespace std; using ll=long long; const int mod=998244353; const int g=3,gi=332748118,NR=1<<19,maxn=125009; int n=1,m,a[NR],b[NR],tot,rev[NR],bit,ans[10][10][maxn],ls,lt,sig; bitset<300> vis; char
4.5k4 分钟

最近霉运连连,微信消息no response搞得去蹭曾老师的球台vp,QQ因为某事炸号 E题主要是先树链剖分,然后像吉司机线段树那样对一些有规律的区间进行标记,减少操作数。 莫比乌斯函数打表发现最多加一次就可以到达的循环中或者直接对应的莫比乌斯函数值为0即: code: #include <bits/stdc++.h> using namespace std; using ll=long long; ll n,q, a[(int)1e6+9],M,p[(int)4e6+9],dep[(int)1e5+9],sz[(int)1e5+9],top[(in
1.9k2 分钟

暴力枚举集合划分,然后字符串哈希更新答案 #include <bits/stdc++.h> /* #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/hash_policy.hpp> */ using namespace std; const double eps = 1e-10; const double pi = 3.1415926535897932384626433832795; const do
2.8k3 分钟

考虑a只有一个和多个这两种本质不同计数方法。 一个的数量为,则有 多个的数量为,则有 而对于每个b,我们可以用NTT算出需要至个a的方案数 于是就得到一个方案,枚举b用NTT计算出a贡献,然后再枚举问询加上相应的贡献到答案上 #include <bits/stdc++.h> /* #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/hash_policy.hpp> */ using namespace std; const