結果

問題 No.1183 コイン遊び
ユーザー ShoShimazakiShoShimazaki
提出日時 2020-08-22 14:04:02
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 331 ms / 2,000 ms
コード長 1,110 bytes
コンパイル時間 1,578 ms
コンパイル使用メモリ 165,620 KB
実行使用メモリ 15,196 KB
最終ジャッジ日時 2024-04-23 08:28:59
合計ジャッジ時間 10,423 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 8 ms
5,376 KB
testcase_11 AC 21 ms
5,376 KB
testcase_12 AC 203 ms
10,624 KB
testcase_13 AC 180 ms
9,728 KB
testcase_14 AC 306 ms
14,336 KB
testcase_15 AC 323 ms
15,196 KB
testcase_16 AC 322 ms
15,044 KB
testcase_17 AC 322 ms
14,976 KB
testcase_18 AC 325 ms
15,144 KB
testcase_19 AC 324 ms
14,976 KB
testcase_20 AC 322 ms
14,976 KB
testcase_21 AC 303 ms
14,976 KB
testcase_22 AC 300 ms
14,976 KB
testcase_23 AC 314 ms
14,976 KB
testcase_24 AC 317 ms
14,928 KB
testcase_25 AC 320 ms
14,976 KB
testcase_26 AC 324 ms
14,972 KB
testcase_27 AC 331 ms
14,976 KB
testcase_28 AC 323 ms
15,140 KB
testcase_29 AC 299 ms
14,976 KB
testcase_30 AC 309 ms
15,104 KB
testcase_31 AC 322 ms
14,976 KB
testcase_32 AC 322 ms
14,992 KB
testcase_33 AC 321 ms
14,976 KB
testcase_34 AC 322 ms
14,964 KB
権限があれば一括ダウンロードができます

ソースコード

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