1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#include<bits/stdc++.h> #define ll long long int using namespace std; ll (char *s,int m){ ll h=0; for(int i=0;s[i];i++) h=((h<<8)+s[i])%m; return h; } int main(){ #ifdef LOCAL #endif char a[100]="22222222222222222222222222222"; char b[100]="22222222222222222222222223222"; printf("%lldn",gethash(a,1e9+7)); printf("%lldn",gethash(b,1e9+7)); }
|
近期评论