您当前的位置: 首页 > 

HeartFireY

暂无认证

  • 3浏览

    0关注

    334博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

牛客练习赛95 ABC

HeartFireY 发布时间:2022-01-20 22:48:44 ,浏览量:3

每天默念三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             
关注
打赏
1662600635
查看更多评论
0.0592s