Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3ee36d6

Browse files
Update string_hashing.cpp
1 parent f1316a7 commit 3ee36d6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/string_hashing.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ class StringHash {
1919
ll m = 1000000007;
2020

2121
ll B[MAX], inverseB[MAX];
22-
23-
public:
22+
2423
void initialize() {
2524
B[0]=1;
2625
for (int i = 1; i < MAX; i++) {
@@ -31,6 +30,11 @@ class StringHash {
3130
inverseB[i]=(inverseB[i+1]*b)%m;
3231
}
3332
}
33+
34+
public:
35+
StringHash() {
36+
initialize();
37+
}
3438

3539
ll getHash(char *s) {
3640
long long h = 0;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /