Submission #427929

#TimeUsernameProblemLanguageResultExecution timeMemory
427929tengiz05Lamps (JOI19_lamps)C++17
4 / 100
10 ms4412 KiB
#include <bits/stdc++.h> int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int n; std::cin >> n; std::string a, b; std::cin >> a >> b; int ans = 0; for (int i = 0; i < n; i++) { if (b[i] != '1') { continue; } while (i + 1 < n && b[i + 1] == '1') { i++; } ans++; } std::cout << ans << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...