結果

問題 No.1183 コイン遊び
ユーザー yorry2101yorry2101
提出日時 2023-06-22 14:41:34
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 556 bytes
コンパイル時間 594 ms
コンパイル使用メモリ 73,040 KB
実行使用メモリ 11,152 KB
最終ジャッジ日時 2023-09-12 09:08:47
合計ジャッジ時間 11,097 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,384 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 19 ms
4,380 KB
testcase_12 AC 180 ms
7,776 KB
testcase_13 WA -
testcase_14 AC 266 ms
10,336 KB
testcase_15 WA -
testcase_16 AC 284 ms
10,872 KB
testcase_17 WA -
testcase_18 AC 285 ms
10,920 KB
testcase_19 WA -
testcase_20 AC 284 ms
10,772 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 286 ms
10,828 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 285 ms
10,792 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 286 ms
10,864 KB
testcase_32 WA -
testcase_33 AC 285 ms
10,924 KB
testcase_34 AC 284 ms
10,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(void){
    int n;
    cin >> n;
    vector<int> a(n), b(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> b[i];
    }
    
    bool msrng = true;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        if (a[i] == b[i] && msrng) {
            msrng = false;
            cnt++;
        }
        else if (a[i] != b[i] && !msrng) {
            msrng = true;
        }
    }
    if (msrng) cnt++;
    cout << cnt << endl;
}
0