結果

問題 No.1183 コイン遊び
ユーザー pes_magic
提出日時 2020-08-22 13:06:40
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 346 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 857 ms
コンパイル使用メモリ 70,904 KB
実行使用メモリ 14,976 KB
最終ジャッジ日時 2024-10-15 07:12:14
合計ジャッジ時間 9,062 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

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