結果

問題 No.1183 コイン遊び
ユーザー ShoShimazaki
提出日時 2020-08-22 14:04:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 1,110 bytes
コンパイル時間 1,638 ms
コンパイル使用メモリ 168,540 KB
実行使用メモリ 15,104 KB
最終ジャッジ日時 2024-10-15 08:20:42
合計ジャッジ時間 10,494 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using str = string;
using ll = long long;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define RREP(i,n) for(int i=int(n)-1; i>=0; i--)
#define FOR(i,f,t) for(int i=int(f); i<=int(t); i++)
#define RFOR(i,f,t) for(int i=int(f); i>=int(t); i--)
#define ALL(vec) (vec).begin(),(vec).end()
#define ASORT(vec) sort(ALL(vec))
#define DSORT(vec) sort(ALL(vec), greater<int>());
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define YES(ans) if(ans) cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define Yes(ans) if(ans) cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define yes(ans) if(ans) cout<<"yes"<<endl; else cout<<"no"<<endl;

int main() {
    int n;
    cin >> n;
    vector<int> A(n);
    vector<int> B(n);
    REP(i, n) cin >> A.at(i);
    REP(i, n) cin >> B.at(i);

    vector<int> data(n);
    REP(i, n) {
        if( A.at(i) == B.at(i) ) data.at(i) = 0;
        else data.at(i) = 1;
    }

    int count=0;
    REP(i, n-1) if( data.at(i) == 0 && data.at(i+1) == 1 ) count++;
    if( data.at(0) == 1 ) count++;

    cout << count << endl;
}
0