結果

問題 No.1183 コイン遊び
ユーザー Cyclone28
提出日時 2020-08-22 17:27:43
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 478 bytes
コンパイル時間 1,692 ms
コンパイル使用メモリ 169,292 KB
実行使用メモリ 11,224 KB
最終ジャッジ日時 2024-10-15 11:18:43
合計ジャッジ時間 9,782 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 19 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> b(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    for(int i = 0; i < n; i++){
        cin >> b[i];
    }
    int ans = 0;
    bool flag = true;
    for(int i = 0; i < n; i++){
        if(a[i] != b[i]){
            flag = false;
        }
        else{
            if(!flag) {ans++; flag = true;}
        }
    }
    cout << ans << endl;
}
0