您现在在云梯。
(图中实线表示有直接到达的链接,虚线表示可通过某种方式间接到达)
由于我的文章日益增多,所以急需一个??来整理下这些文章。
0924upd:可惜了现在没法弄无向边了。
trash?
我们使用一个多项式滚动字符串哈希,具体代码如下:
#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
string s;
long long P=13331,ans;
int main(){
cin>>s;
for(int i=0;i<s.size();i++){
ans=ans*P+s[i],ans%=mod;
}
cout<<ans;
return 0;
}这玩意好像好像没有必要,扔了。
