// author: erray
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
string a, b;
cin >> n >> a >> b;
assert(count(a.begin(), a.end(), '0') == n);
int ans = 0;
for (int i = 1; i < n; ++i) {
if (b[i] == '1' && b[i - 1] == '0') {
++ans;
}
}
cout << ans + (b[0] == '1') << '\n';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
8 ms |
4328 KB |
Output is correct |
8 |
Correct |
8 ms |
4388 KB |
Output is correct |
9 |
Correct |
11 ms |
4328 KB |
Output is correct |
10 |
Correct |
8 ms |
4380 KB |
Output is correct |
11 |
Correct |
8 ms |
4384 KB |
Output is correct |
12 |
Correct |
8 ms |
4328 KB |
Output is correct |
13 |
Correct |
11 ms |
4332 KB |
Output is correct |
14 |
Correct |
8 ms |
4384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |