結果

問題 No.1183 コイン遊び
ユーザー pes_magicpes_magic
提出日時 2020-08-22 13:06:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 288 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 649 ms
コンパイル使用メモリ 72,592 KB
実行使用メモリ 18,052 KB
最終ジャッジ日時 2024-04-23 07:23:07
合計ジャッジ時間 8,594 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 3 ms
6,944 KB
testcase_10 AC 7 ms
6,940 KB
testcase_11 AC 19 ms
6,944 KB
testcase_12 AC 178 ms
12,240 KB
testcase_13 AC 156 ms
12,044 KB
testcase_14 AC 263 ms
16,164 KB
testcase_15 AC 275 ms
16,832 KB
testcase_16 AC 277 ms
17,680 KB
testcase_17 AC 280 ms
17,660 KB
testcase_18 AC 279 ms
16,872 KB
testcase_19 AC 274 ms
16,864 KB
testcase_20 AC 279 ms
18,052 KB
testcase_21 AC 271 ms
15,924 KB
testcase_22 AC 263 ms
17,032 KB
testcase_23 AC 277 ms
17,784 KB
testcase_24 AC 282 ms
17,388 KB
testcase_25 AC 282 ms
15,644 KB
testcase_26 AC 278 ms
16,860 KB
testcase_27 AC 288 ms
16,572 KB
testcase_28 AC 283 ms
17,412 KB
testcase_29 AC 267 ms
16,008 KB
testcase_30 AC 268 ms
17,544 KB
testcase_31 AC 279 ms
17,120 KB
testcase_32 AC 285 ms
15,736 KB
testcase_33 AC 281 ms
16,620 KB
testcase_34 AC 277 ms
16,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

using namespace std;

int main(){
    int N;
    while(cin >> N){
        vector<int> A(N), B(N);
        for(auto& t : A) cin >> t;
        for(auto& t : B) cin >> t;
        int res = 0;
        A.push_back(0);
        B.push_back(0);
        for(int i=1;i<=N;i++){
            if(A[i-1] != B[i-1] && A[i] == B[i]) ++res;
        }
        cout << res << endl;
    }
}
0