首页 > 其他 > 详细

找出数据结构

时间:2020-04-03 20:49:09      阅读:55      评论:0      收藏:0      [点我收藏+]

技术分享图片

 

 

#include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 100001;
string str;
int s,sj,g;
int ans;
signed main(){
    ios::sync_with_stdio(0);
    getline(cin,str);
    int len = str.size();
    for(int i = 0; i < len; i++)
        if(str[i] == G) g++;
    for(int i = 0; i < len; i++){
        if(str[i] == G) g--;
        if(str[i] == S) s++;
        if(str[i] == J){
            ans = (ans + sj * g) % mod;
            sj += s;
        }
    }
    cout << ans;
    return 0;
}

 

找出数据结构

原文:https://www.cnblogs.com/xcfxcf/p/12628815.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!