# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
376180 |
2021-03-11T03:32:12 Z |
8e7 |
Lamps (JOI19_lamps) |
C++14 |
|
8 ms |
2840 KB |
//Challenge: Accepted
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <set>
#define ll long long
#define maxn 200005
#define pii pair<int, ll>
#define ff first
#define ss second
#define mod 1000000007
#define io ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
string a, b;
int main() {
io
int n;
cin >> n;
cin >> a >> b;
int cur = 0, cnt = 0;
for (int i = 0;i < n;i++) {
if (b[i] - '0' != cur) {
cur ^= 1;
cnt++;
}
}
if (b[n - 1] == '0') cnt--;
cout << (cnt + 1) / 2 << "\n";
}
/*
6
000000
001110
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
5 ms |
2824 KB |
Output is correct |
8 |
Correct |
5 ms |
2824 KB |
Output is correct |
9 |
Correct |
8 ms |
2840 KB |
Output is correct |
10 |
Correct |
5 ms |
2824 KB |
Output is correct |
11 |
Correct |
7 ms |
2824 KB |
Output is correct |
12 |
Correct |
7 ms |
2824 KB |
Output is correct |
13 |
Correct |
5 ms |
2824 KB |
Output is correct |
14 |
Correct |
6 ms |
2824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |