Submission #792423

# Submission time Handle Problem Language Result Execution time Memory
792423 2023-07-25T04:42:05 Z vjudge1 Lamps (JOI19_lamps) C++14
4 / 100
24 ms 4188 KB
#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 time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 328 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 19 ms 4172 KB Output is correct
8 Correct 21 ms 4108 KB Output is correct
9 Correct 24 ms 4188 KB Output is correct
10 Correct 21 ms 4172 KB Output is correct
11 Correct 20 ms 4120 KB Output is correct
12 Correct 20 ms 4128 KB Output is correct
13 Correct 24 ms 4172 KB Output is correct
14 Correct 19 ms 4172 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -