Submission #589186

#TimeUsernameProblemLanguageResultExecution timeMemory
589186SlavicGLamps (JOI19_lamps)C++17
4 / 100
6 ms4436 KiB
#include "bits/stdc++.h" using namespace std; #define ll long long #define forn(i,n) for(int i=0;i<n;i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(),v.rend() #define pb push_back #define sz(a) (int)a.size() void solve() { int n; string a, b; cin >> n >> a >> b; int ans = 0; forn(i, n) { if(b[i] == '1') ans += (i == 0 || b[i - 1] == '0'); } cout << ans; } int32_t main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); int t = 1; //cin >> t; while(t--) { solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...