#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, n+1)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
#define pb push_back
#define pii pair<int, int>
#define f first
#define s second
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)((x).size())
#define endl '\n'
const ll maxn = 3e5+5;
const ll inf = (1ll<<60);
const ll mod = 1e9+7;
signed main(){
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int n; cin>>n;
string a, b; cin>>a>>b;
int cnt = 0;
b = '0'+b+'0';
REP(i, n+1){
if (b[i] != b[i+1]) cnt++;
}
cout<<cnt/2<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
4 ms |
4524 KB |
Output is correct |
8 |
Correct |
5 ms |
4524 KB |
Output is correct |
9 |
Correct |
4 ms |
4272 KB |
Output is correct |
10 |
Correct |
4 ms |
4268 KB |
Output is correct |
11 |
Correct |
5 ms |
4272 KB |
Output is correct |
12 |
Correct |
5 ms |
5896 KB |
Output is correct |
13 |
Correct |
6 ms |
5156 KB |
Output is correct |
14 |
Correct |
5 ms |
5376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |