結果

問題 No.1183 コイン遊び
ユーザー Cyclone28Cyclone28
提出日時 2020-08-22 17:27:43
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 478 bytes
コンパイル時間 1,722 ms
コンパイル使用メモリ 164,380 KB
実行使用メモリ 11,256 KB
最終ジャッジ日時 2024-04-23 11:23:15
合計ジャッジ時間 9,704 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 2 ms
6,940 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 172 ms
8,064 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 283 ms
11,204 KB
testcase_16 AC 287 ms
10,996 KB
testcase_17 AC 280 ms
11,060 KB
testcase_18 AC 288 ms
11,084 KB
testcase_19 AC 280 ms
11,024 KB
testcase_20 AC 277 ms
10,996 KB
testcase_21 AC 267 ms
11,128 KB
testcase_22 AC 264 ms
11,016 KB
testcase_23 WA -
testcase_24 AC 276 ms
11,168 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 262 ms
11,184 KB
testcase_30 WA -
testcase_31 AC 288 ms
11,160 KB
testcase_32 AC 309 ms
11,164 KB
testcase_33 WA -
testcase_34 AC 303 ms
11,072 KB
権限があれば一括ダウンロードができます

ソースコード

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