每天默念三W遍我是废物
A.Duplicate Strings统计存一下初始字符的数量,然后开一个全局标记不断地 ( t a g + 1 ) × x (tag+1)\times x (tag+1)×x即可,记得取模。
#include
#define int long long
using namespace std;
const int N = 1e5 + 10, MOD = 1e9 + 7;
int a[N], book;
inline void solve(){
int n, q; cin >> n >> q; book = 1;
for(int i = 1; i > x;
a[x - 'a' + 1] = (a[x - 'a' + 1] + 1) % MOD;
}
while(q--){
int op = 0; cin >> op;
if(op == 1){
int t; cin >> t;
book = (t + 1) * book % MOD;
}
else{
char x; cin >> x;
cout
关注
打赏
热门博文
- 回坑记之或许是退役赛季?
- [LCT刷题] P1501 [国家集训队]Tree II
- [LCT刷题] P2147 洞穴勘测
- 2022-2023 ICPC Brazil Subregional Programming Contest VP记录
- [线段树套单调栈] 2019-2020 ICPC Asia Hong Kong Regional Contest H.[Hold the Line]
- The 2021 ICPC Asia Nanjing Regional Contest E.Paimon Segment Tree 区间合并线段树/维护矩阵乘法
- CF580E - Kefa and Watch 线段树维护哈希
- HDU5869 Different GCD Subarray Query 离线查询/区间贡献
- 27.CF1004F Sonya and Bitwise OR 区间合并线段树
- 26.CF1000F One Occurrence