#include<bits/stdc++.h>
using namespace std;
typedef long long int lld;
typedef pair<lld,lld> pii;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
int main(){
int n;
cin>>n;
string A,B;
cin>>A>>B;
bool comp=false;
int ans=0;
rep(i,0,n){
if(B.at(i)=='0'){
ans+=comp;
comp=false;
}else{
comp=true;
}
}
ans+=comp;
cout<<ans<<endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
4 |
Correct |
2 ms |
256 KB |
Output is correct |
5 |
Correct |
2 ms |
256 KB |
Output is correct |
6 |
Correct |
2 ms |
256 KB |
Output is correct |
7 |
Correct |
61 ms |
6220 KB |
Output is correct |
8 |
Correct |
60 ms |
6120 KB |
Output is correct |
9 |
Correct |
63 ms |
6120 KB |
Output is correct |
10 |
Correct |
60 ms |
6120 KB |
Output is correct |
11 |
Correct |
62 ms |
6140 KB |
Output is correct |
12 |
Correct |
62 ms |
6120 KB |
Output is correct |
13 |
Correct |
60 ms |
6120 KB |
Output is correct |
14 |
Correct |
64 ms |
6248 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |