Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define uns unsigned
- #define ll long long
- const char newline('\n');
- using namespace std;
- ///**************************contest setup
- string a, b;
- unsigned res;
- int main()
- {
- getline(cin, a);
- getline(cin, b);
- const int sa = a.size(), sb = b.size();
- vector <int> spa(sa + 5, 0);
- for (int i = 1; i <= sa; i++)
- {
- spa.at(i) = spa.at(i - 1) + int(a.at(i - 1) - '0');
- }
- const int nrof1 = count(b.begin(), b.end(), '1');
- for (int i = sb; i <= sa ; i++)
- {
- if (((spa.at(i) - spa.at(i - sb)) % 2) == (nrof1 % 2))
- res++;
- }
- cout << res;//*/
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement