답안 #874070

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
874070 2023-11-16T08:49:16 Z vjudge1 Lamps (JOI19_lamps) C++17
4 / 100
5 ms 4524 KB
#include<bits/stdc++.h>
     
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
 
#define pb              push_back
#define F               first
#define S               second
//#define mp              make_pair
#define all(x)          x.begin(),x.end()
#define file            freopen("txt.in", "r", stdin);freopen("txt.out", "w", stdout);
#define kill(x)         {cout << x << '\n'; return 0;}
//#define int				ll

#pragma GCC optimize("Ofast,unroll-loops")

const int N =  300 * 1000 + 10, LG = 24, MOD = 1e9+7, P = 701;
const ll inf = 1e12;

int n;
string s, t;

signed main(){
   //file;
    ios::sync_with_stdio(0);cin.tie(0);
    
    cin >> n >> s >> t;    
    
    int cnt0 = 0;
    for(int i = 0; i < n; ++i) {
        cnt0 += (s[i] == '0');
    }
    if(cnt0 == n) {
        t = t+'0';
        int ans = 0;
        for(int i = 1; i <= n; ++i) {
            if(t[i-1] == '1' && t[i] == '1') continue;
            if(t[i-1] == '1') ++ans;
        }
        cout << ans << '\n';
    }
    
}   

# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 4 ms 4524 KB Output is correct
8 Correct 4 ms 4524 KB Output is correct
9 Correct 4 ms 4272 KB Output is correct
10 Correct 4 ms 4524 KB Output is correct
11 Correct 4 ms 4272 KB Output is correct
12 Correct 5 ms 4272 KB Output is correct
13 Correct 4 ms 4384 KB Output is correct
14 Correct 4 ms 4272 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -