結果

問題 No.1183 コイン遊び
ユーザー pes_magicpes_magic
提出日時 2020-08-22 13:06:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 292 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 797 ms
コンパイル使用メモリ 71,488 KB
実行使用メモリ 17,320 KB
最終ジャッジ日時 2023-08-05 09:49:34
合計ジャッジ時間 8,948 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 7 ms
4,376 KB
testcase_11 AC 18 ms
4,380 KB
testcase_12 AC 177 ms
11,600 KB
testcase_13 AC 151 ms
11,080 KB
testcase_14 AC 264 ms
16,572 KB
testcase_15 AC 279 ms
16,828 KB
testcase_16 AC 281 ms
15,276 KB
testcase_17 AC 282 ms
15,488 KB
testcase_18 AC 287 ms
16,404 KB
testcase_19 AC 285 ms
15,856 KB
testcase_20 AC 281 ms
17,320 KB
testcase_21 AC 269 ms
16,716 KB
testcase_22 AC 273 ms
16,380 KB
testcase_23 AC 286 ms
15,764 KB
testcase_24 AC 292 ms
17,080 KB
testcase_25 AC 285 ms
16,508 KB
testcase_26 AC 279 ms
15,896 KB
testcase_27 AC 285 ms
17,168 KB
testcase_28 AC 284 ms
15,924 KB
testcase_29 AC 264 ms
15,300 KB
testcase_30 AC 273 ms
15,880 KB
testcase_31 AC 283 ms
15,668 KB
testcase_32 AC 281 ms
17,088 KB
testcase_33 AC 285 ms
16,324 KB
testcase_34 AC 276 ms
15,684 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