#include<bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n;
string s, t;
cin>>n>>s>>t;
int cnt=0;
for(int i=0; i<n; ++i) {
if(t[i]=='1' && (i==0 || t[i-1]!=t[i])) {
cnt++;
}
}
cout<<cnt;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
4 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
5 ms |
384 KB |
Output is correct |
6 |
Correct |
4 ms |
384 KB |
Output is correct |
7 |
Correct |
10 ms |
2844 KB |
Output is correct |
8 |
Correct |
11 ms |
4436 KB |
Output is correct |
9 |
Correct |
13 ms |
4508 KB |
Output is correct |
10 |
Correct |
10 ms |
4508 KB |
Output is correct |
11 |
Correct |
11 ms |
4436 KB |
Output is correct |
12 |
Correct |
10 ms |
4436 KB |
Output is correct |
13 |
Correct |
11 ms |
4436 KB |
Output is correct |
14 |
Correct |
10 ms |
4436 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |