MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / main

Function main

Strings/String Hashing.cpp:64–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 }
63};
64int32_t main() {
65 ios_base::sync_with_stdio(0);
66 cin.tie(0);
67 prec();
68 int n;
69 while (cin >> n) {
70 string s, p;
71 cin >> p >> s;
72 Hashing h(s);
73 auto hs = Hashing(p).get_hash();
74 for(int i = 1; i + n - 1 <= s.size(); i++) {
75 if (h.get_hash(i, i + n - 1) == hs) cout << i - 1 << '\n';
76 }
77 cout << '\n';
78 }
79 return 0;
80}
81// https://www.spoj.com/problems/NHAY/

Callers

nothing calls this directly

Calls 4

precFunction · 0.70
HashingClass · 0.70
get_hashMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected