結果

問題 No.1995 CHIKA Road
ユーザー ryusukeryusuke
提出日時 2022-07-01 22:52:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 410 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 94,212 KB
最終ジャッジ日時 2023-08-17 10:29:43
合計ジャッジ時間 10,526 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,236 KB
testcase_01 AC 68 ms
71,048 KB
testcase_02 AC 68 ms
71,168 KB
testcase_03 AC 65 ms
70,992 KB
testcase_04 AC 70 ms
71,108 KB
testcase_05 AC 68 ms
71,144 KB
testcase_06 AC 113 ms
77,840 KB
testcase_07 AC 166 ms
81,840 KB
testcase_08 AC 71 ms
71,236 KB
testcase_09 AC 70 ms
71,240 KB
testcase_10 AC 396 ms
93,704 KB
testcase_11 AC 387 ms
93,944 KB
testcase_12 AC 410 ms
93,832 KB
testcase_13 AC 187 ms
82,888 KB
testcase_14 AC 189 ms
82,956 KB
testcase_15 AC 353 ms
92,004 KB
testcase_16 AC 127 ms
79,292 KB
testcase_17 AC 263 ms
87,464 KB
testcase_18 AC 385 ms
94,212 KB
testcase_19 AC 392 ms
94,168 KB
testcase_20 AC 251 ms
86,476 KB
testcase_21 AC 232 ms
85,620 KB
testcase_22 AC 377 ms
93,024 KB
testcase_23 AC 172 ms
81,976 KB
testcase_24 AC 339 ms
91,372 KB
testcase_25 AC 139 ms
80,204 KB
testcase_26 AC 186 ms
82,744 KB
testcase_27 AC 328 ms
90,632 KB
testcase_28 AC 229 ms
85,456 KB
testcase_29 AC 382 ms
93,452 KB
testcase_30 AC 132 ms
79,924 KB
testcase_31 AC 109 ms
77,896 KB
testcase_32 AC 147 ms
80,896 KB
testcase_33 AC 323 ms
90,136 KB
testcase_34 AC 111 ms
77,712 KB
testcase_35 AC 178 ms
82,396 KB
testcase_36 AC 198 ms
83,600 KB
testcase_37 AC 371 ms
92,968 KB
testcase_38 AC 277 ms
88,056 KB
testcase_39 AC 108 ms
78,016 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