#include<bits/stdc++.h>
using namespace std;
const int N = 1e6+1;
int dp[N][4][4][4];
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 |
4 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 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 |
9 ms |
4252 KB |
Output is correct |
8 |
Correct |
10 ms |
4380 KB |
Output is correct |
9 |
Correct |
10 ms |
4496 KB |
Output is correct |
10 |
Correct |
10 ms |
4372 KB |
Output is correct |
11 |
Correct |
10 ms |
4500 KB |
Output is correct |
12 |
Correct |
10 ms |
4508 KB |
Output is correct |
13 |
Correct |
10 ms |
4508 KB |
Output is correct |
14 |
Correct |
10 ms |
4380 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |