Submission #427937

#TimeUsernameProblemLanguageResultExecution timeMemory
427937milleniumEeeeLamps (JOI19_lamps)C++17
4 / 100
69 ms4152 KiB
#include <bits/stdc++.h> using namespace std; signed main() { int n; cin >> n; string a, b; cin >> a >> b; a = ' ' + a; b = ' ' + b; int ans = 0; for (int i = 1; i <= n; i++) { if (b[i] == '1') { int r = i; while (r <= n && b[r] == '1') { r++; }r--; ans++; i = r; } } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...