-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path16172.cpp
38 lines (37 loc) · 1.07 KB
/
16172.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
int main()
{
string temp;
string substring;
cin >> temp >>substring;
ll h = 0;
string str;
for (int i = 0; i < temp.size(); i++) if (temp[i] >= '0' && temp[i] <= '9') continue; else str += temp[i];
// for (int i = 0; i < substring.size(); i++) h += substring[i] * 1000007;
cout << (str.find(substring) < str.size());
// ll z=0, l=0;
// for (int i = 0; i < str.size(); i++) {
// z += str[i] * 1000007;
// while (z > h && l < i) {
// z -= str[l] * 1000007;
// l++;
// }
// if (z == h) {
// bool found = true;
// for (int j = 0; j < substring.size(); j++) {
// if (str[l + j] == substring[j]) continue;
// found = false;
// break;
// }
// if (found) {
// cout << 1;
// return 0;
// }
// }
// }
// cout << 0;
return 0;
}