結果

問題 No.1183 コイン遊び
ユーザー kokatsukokatsu
提出日時 2022-04-16 20:12:12
言語 D
(dmd 2.107.1)
結果
AC  
実行時間 179 ms / 2,000 ms
コード長 424 bytes
コンパイル時間 3,979 ms
コンパイル使用メモリ 210,992 KB
実行使用メモリ 52,196 KB
最終ジャッジ日時 2023-09-04 16:49:07
合計ジャッジ時間 11,390 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 5 ms
4,468 KB
testcase_11 AC 12 ms
9,148 KB
testcase_12 AC 105 ms
29,148 KB
testcase_13 AC 94 ms
28,900 KB
testcase_14 AC 173 ms
49,456 KB
testcase_15 AC 179 ms
51,296 KB
testcase_16 AC 177 ms
52,072 KB
testcase_17 AC 177 ms
52,072 KB
testcase_18 AC 177 ms
52,084 KB
testcase_19 AC 176 ms
52,128 KB
testcase_20 AC 176 ms
52,032 KB
testcase_21 AC 169 ms
52,096 KB
testcase_22 AC 170 ms
52,196 KB
testcase_23 AC 170 ms
52,048 KB
testcase_24 AC 170 ms
52,052 KB
testcase_25 AC 176 ms
52,044 KB
testcase_26 AC 176 ms
52,172 KB
testcase_27 AC 177 ms
52,056 KB
testcase_28 AC 176 ms
52,056 KB
testcase_29 AC 170 ms
52,116 KB
testcase_30 AC 169 ms
52,024 KB
testcase_31 AC 176 ms
52,028 KB
testcase_32 AC 175 ms
52,008 KB
testcase_33 AC 175 ms
52,144 KB
testcase_34 AC 175 ms
51,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int N;
    readf("%d\n", N);

    auto A = readln.chomp.split.to!(int[]);
    auto B = readln.chomp.split.to!(int[]);

    int res;
    bool rev;
    foreach (a, b; zip(A, B)) {
        if (a == b) {
            if (rev) {
                ++res;
                rev = false;
            }
        }
        else {
            rev = true;
        }
    }
    if (rev) ++res;

    res.writeln;
}
0