結果

問題 No.1995 CHIKA Road
ユーザー ryusukeryusuke
提出日時 2022-07-01 22:52:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 412 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 82,084 KB
実行使用メモリ 93,056 KB
最終ジャッジ日時 2024-05-04 17:17:39
合計ジャッジ時間 9,765 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,968 KB
testcase_01 AC 38 ms
51,456 KB
testcase_02 AC 38 ms
51,840 KB
testcase_03 AC 38 ms
51,584 KB
testcase_04 AC 38 ms
51,968 KB
testcase_05 AC 42 ms
52,864 KB
testcase_06 AC 100 ms
76,800 KB
testcase_07 AC 169 ms
80,512 KB
testcase_08 AC 45 ms
53,376 KB
testcase_09 AC 42 ms
53,120 KB
testcase_10 AC 400 ms
92,672 KB
testcase_11 AC 392 ms
92,672 KB
testcase_12 AC 412 ms
92,544 KB
testcase_13 AC 173 ms
81,792 KB
testcase_14 AC 179 ms
81,792 KB
testcase_15 AC 361 ms
90,880 KB
testcase_16 AC 115 ms
78,592 KB
testcase_17 AC 267 ms
86,656 KB
testcase_18 AC 393 ms
92,928 KB
testcase_19 AC 405 ms
93,056 KB
testcase_20 AC 262 ms
85,376 KB
testcase_21 AC 225 ms
84,736 KB
testcase_22 AC 385 ms
92,160 KB
testcase_23 AC 160 ms
81,408 KB
testcase_24 AC 334 ms
90,240 KB
testcase_25 AC 122 ms
78,720 KB
testcase_26 AC 173 ms
81,920 KB
testcase_27 AC 326 ms
89,472 KB
testcase_28 AC 219 ms
84,224 KB
testcase_29 AC 388 ms
92,160 KB
testcase_30 AC 118 ms
78,592 KB
testcase_31 AC 93 ms
77,056 KB
testcase_32 AC 137 ms
79,616 KB
testcase_33 AC 315 ms
89,088 KB
testcase_34 AC 103 ms
76,928 KB
testcase_35 AC 173 ms
81,024 KB
testcase_36 AC 183 ms
82,432 KB
testcase_37 AC 366 ms
91,648 KB
testcase_38 AC 266 ms
87,296 KB
testcase_39 AC 93 ms
76,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())

g = [list(map(int, input().split())) for _ in range(m)]
g.sort(key=lambda x: (x[1], x[0]))

start, end = g[0][0], g[0][1]
ans = 1
for i in range(1, m):
    if end <= g[i][0]:
        start, end = g[i][0], g[i][1]
        ans += 1

print(2 * (n - 1) - ans)
0