結果

問題 No.1995 CHIKA Road
ユーザー kokatsukokatsu
提出日時 2022-07-01 22:33:00
言語 D
(dmd 2.107.1)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 2,502 ms
コンパイル使用メモリ 214,868 KB
実行使用メモリ 6,416 KB
最終ジャッジ日時 2023-09-04 17:39:07
合計ジャッジ時間 5,535 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 6 ms
4,376 KB
testcase_07 AC 20 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 55 ms
4,892 KB
testcase_11 AC 84 ms
6,416 KB
testcase_12 AC 77 ms
4,932 KB
testcase_13 AC 28 ms
4,376 KB
testcase_14 AC 30 ms
4,376 KB
testcase_15 AC 74 ms
4,684 KB
testcase_16 AC 11 ms
4,380 KB
testcase_17 AC 43 ms
4,376 KB
testcase_18 AC 70 ms
4,948 KB
testcase_19 AC 70 ms
4,888 KB
testcase_20 AC 38 ms
4,376 KB
testcase_21 AC 35 ms
4,380 KB
testcase_22 AC 67 ms
4,856 KB
testcase_23 AC 21 ms
4,376 KB
testcase_24 AC 59 ms
4,664 KB
testcase_25 AC 13 ms
4,380 KB
testcase_26 AC 24 ms
4,376 KB
testcase_27 AC 57 ms
4,588 KB
testcase_28 AC 35 ms
4,376 KB
testcase_29 AC 68 ms
4,936 KB
testcase_30 AC 12 ms
4,376 KB
testcase_31 AC 6 ms
4,380 KB
testcase_32 AC 15 ms
4,380 KB
testcase_33 AC 55 ms
4,576 KB
testcase_34 AC 7 ms
4,376 KB
testcase_35 AC 23 ms
4,376 KB
testcase_36 AC 27 ms
4,376 KB
testcase_37 AC 65 ms
4,896 KB
testcase_38 AC 45 ms
4,380 KB
testcase_39 AC 6 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

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

    auto A = new long[](M), B = new long[](M);
    foreach (i; 0 .. M) readf("%d %d\n", A[i], B[i]);

    zip(A, B).sort!"a[1] < b[1]";

    long cnt = 1, pos = B[0];
    foreach (i; 1 .. M) {
        if (pos > A[i]) continue;

        ++cnt, pos = B[i];
    }

    long res = (N - 1) * 2 - cnt;
    res.writeln;
}
0