#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; int main(){ string s ; cin >>s; int m; cin >>m; vector<int> l(m),r(m); ; i < m ; ++ i ) cin >> l[i]>>…
#include <bits/stdc++.h> #define llong long long using namespace std; const int N = 1e5; const int P = 1e9+; const llong INV2 = 5e8+; int nxt[N+]; int lstpos[N+]; int a[N+]; int num[N+]; int cnum[N+]; llong tmp0[N+],tmp1[N+],tmp2[N+]; vector<int&…
A. Sereja and Algorithm 水题不解释. B. Sereja ans Anagrams 模p同余的为一组,随便搞. C. Sereja and the Arrangement of Numbers 我还以为是找规律... 把每个数当成一个点.就有一个图.让后求欧拉路什么的. D. Sereja and Sets 这个思路感觉很巧妙(可能是我太弱了),我们对于每一段连续的d,找到不包含它们的所有集合,这些集合的子集一定不可行. 见代码. /* * Problem: D. Ser…