• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

Recommended Posts

6050. 字符串的总引力




那么左端点在\([H 1,i]\)右端点在\([i,n]\)的子串都可以贡献1。

所以每次\(RES=(I-H)*(n-I 1)\);



long long appears sum(string s){

使用ll=long long

ll n=s.size(),RES=0;



for(ll I=1;I=n;i) {

RES=(I-H[s-a '])*(n-I 1);//统计数据

h[s-' a ']=I;//更新h





Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now