제출 #376180

#제출 시각아이디문제언어결과실행 시간메모리
3761808e7Lamps (JOI19_lamps)C++14
4 / 100
8 ms2840 KiB
//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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...