Submission #589186

# Submission time Handle Problem Language Result Execution time Memory
589186 2022-07-04T10:11:13 Z SlavicG Lamps (JOI19_lamps) C++17
4 / 100
6 ms 4436 KB
#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 time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 320 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 5 ms 4388 KB Output is correct
8 Correct 6 ms 4396 KB Output is correct
9 Correct 5 ms 4316 KB Output is correct
10 Correct 6 ms 4384 KB Output is correct
11 Correct 5 ms 4376 KB Output is correct
12 Correct 6 ms 4388 KB Output is correct
13 Correct 5 ms 4436 KB Output is correct
14 Correct 5 ms 4336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -