結果

問題 No.1995 CHIKA Road
ユーザー 👑 tamatotamato
提出日時 2022-07-01 21:32:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 406 ms
コンパイル使用メモリ 87,296 KB
実行使用メモリ 82,712 KB
最終ジャッジ日時 2023-08-17 08:51:58
合計ジャッジ時間 6,896 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,504 KB
testcase_01 AC 68 ms
71,596 KB
testcase_02 AC 68 ms
71,356 KB
testcase_03 AC 70 ms
71,448 KB
testcase_04 AC 68 ms
71,468 KB
testcase_05 AC 68 ms
71,436 KB
testcase_06 AC 85 ms
76,516 KB
testcase_07 AC 108 ms
78,496 KB
testcase_08 AC 69 ms
71,384 KB
testcase_09 AC 69 ms
71,344 KB
testcase_10 AC 172 ms
82,620 KB
testcase_11 AC 201 ms
82,712 KB
testcase_12 AC 117 ms
82,684 KB
testcase_13 AC 114 ms
78,792 KB
testcase_14 AC 117 ms
78,660 KB
testcase_15 AC 183 ms
81,704 KB
testcase_16 AC 90 ms
76,624 KB
testcase_17 AC 146 ms
80,956 KB
testcase_18 AC 211 ms
82,504 KB
testcase_19 AC 196 ms
82,360 KB
testcase_20 AC 139 ms
80,416 KB
testcase_21 AC 136 ms
80,136 KB
testcase_22 AC 193 ms
82,276 KB
testcase_23 AC 109 ms
78,804 KB
testcase_24 AC 178 ms
82,468 KB
testcase_25 AC 94 ms
76,964 KB
testcase_26 AC 115 ms
78,788 KB
testcase_27 AC 173 ms
82,352 KB
testcase_28 AC 132 ms
79,788 KB
testcase_29 AC 198 ms
82,340 KB
testcase_30 AC 93 ms
76,968 KB
testcase_31 AC 84 ms
76,924 KB
testcase_32 AC 102 ms
78,324 KB
testcase_33 AC 173 ms
82,384 KB
testcase_34 AC 86 ms
76,944 KB
testcase_35 AC 113 ms
78,528 KB
testcase_36 AC 121 ms
79,256 KB
testcase_37 AC 192 ms
82,400 KB
testcase_38 AC 153 ms
80,904 KB
testcase_39 AC 84 ms
76,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353


def main():
    import sys
    input = sys.stdin.readline

    N, M = map(int, input().split())
    AB = []
    for _ in range(M):
        a, b = map(int, input().split())
        AB.append((a, b))
    AB.sort(key=lambda x: x[1])
    ans = 2 * (N - 1)
    r = 0
    for a, b in AB:
        if a < r:
            continue
        ans -= 1
        r = b
    print(ans)


if __name__ == '__main__':
    main()
0