Submission #792423

#TimeUsernameProblemLanguageResultExecution timeMemory
792423vjudge1Lamps (JOI19_lamps)C++14
4 / 100
24 ms4188 KiB
#include<bits/stdc++.h> #define ll long long #define fi first #define se second using namespace std ; const int N = 1e6 ; int n ; bool flag ; char a[N + 1], b[N + 2] ; signed main() { ios_base::sync_with_stdio( 0 ) ; cin.tie( 0 ) ; cout.tie( 0 ) ; cin >> n ; for(int i = 1 ; i <= n ; i++) { cin >> a[i] ; if(a[i] == '1') flag = 1 ; } for(int i = 1 ; i <= n ; i++) cin >> b[i] ; if(!flag) { int ans = 0 ; b[n + 1] = '0' ; for(int i = 1 ; i <= n ; i++) if(b[i] == '1' && b[i + 1] == '0') ans++ ; cout << ans ; return 0 ; } 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...