Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- string s[2];
- int n = 2;
- int m;
- for (int i = 0; i < n; i++) {
- cin >> s[i];
- m = s[i].length();
- }
- n = m;
- int ans = 0;
- int empty = 0;
- for (int i = 0; i < n; i++) {
- int current = (s[0][i] == '0') + (s[1][i] == '0');
- empty += current;
- if (empty >= 3) {
- empty -= 3;
- ans++;
- }
- else
- empty = current;
- }
- cout << ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement