結果

問題 No.1183 コイン遊び
ユーザー ktr216ktr216
提出日時 2020-08-22 13:09:18
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 292 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 2,029 ms
コンパイル使用メモリ 166,584 KB
実行使用メモリ 11,020 KB
最終ジャッジ日時 2023-08-05 09:56:18
合計ジャッジ時間 10,357 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 7 ms
4,376 KB
testcase_11 AC 19 ms
4,380 KB
testcase_12 AC 180 ms
8,084 KB
testcase_13 AC 159 ms
7,180 KB
testcase_14 AC 265 ms
10,296 KB
testcase_15 AC 282 ms
10,848 KB
testcase_16 AC 284 ms
10,804 KB
testcase_17 AC 282 ms
11,020 KB
testcase_18 AC 283 ms
10,924 KB
testcase_19 AC 285 ms
10,884 KB
testcase_20 AC 284 ms
10,872 KB
testcase_21 AC 271 ms
10,792 KB
testcase_22 AC 273 ms
10,800 KB
testcase_23 AC 292 ms
10,828 KB
testcase_24 AC 292 ms
10,784 KB
testcase_25 AC 284 ms
10,752 KB
testcase_26 AC 284 ms
10,820 KB
testcase_27 AC 287 ms
10,892 KB
testcase_28 AC 284 ms
10,872 KB
testcase_29 AC 277 ms
10,972 KB
testcase_30 AC 280 ms
10,892 KB
testcase_31 AC 281 ms
10,836 KB
testcase_32 AC 283 ms
10,848 KB
testcase_33 AC 283 ms
10,892 KB
testcase_34 AC 283 ms
10,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

typedef long long ll;

int main() {
    int N;
    cin >> N;
    vector<int> A(N + 1, 0), B(N + 1, 0);
    rep(i, N) cin >> A[i + 1];
    rep(i, N) cin >> B[i + 1];
    int c = 0;
    rep(i, N) {
        if ((A[i] ^ B[i]) != (A[i + 1] ^ B[i + 1])) c++;
    }
    cout << (c + 1) / 2 << "\n";
}
0