結果

問題 No.1995 CHIKA Road
ユーザー ニックネームニックネーム
提出日時 2022-07-01 21:54:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 345 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 22,912 KB
最終ジャッジ日時 2023-08-17 09:27:55
合計ジャッジ時間 8,088 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,784 KB
testcase_01 AC 16 ms
7,800 KB
testcase_02 AC 15 ms
7,784 KB
testcase_03 AC 16 ms
7,792 KB
testcase_04 AC 16 ms
7,924 KB
testcase_05 AC 16 ms
7,796 KB
testcase_06 AC 39 ms
9,108 KB
testcase_07 AC 102 ms
12,040 KB
testcase_08 AC 16 ms
7,792 KB
testcase_09 AC 16 ms
7,776 KB
testcase_10 AC 313 ms
19,248 KB
testcase_11 AC 345 ms
22,912 KB
testcase_12 AC 285 ms
22,168 KB
testcase_13 AC 122 ms
13,116 KB
testcase_14 AC 126 ms
13,452 KB
testcase_15 AC 306 ms
21,420 KB
testcase_16 AC 57 ms
9,796 KB
testcase_17 AC 204 ms
16,072 KB
testcase_18 AC 342 ms
21,680 KB
testcase_19 AC 341 ms
21,688 KB
testcase_20 AC 186 ms
15,344 KB
testcase_21 AC 165 ms
14,676 KB
testcase_22 AC 323 ms
21,012 KB
testcase_23 AC 107 ms
12,036 KB
testcase_24 AC 285 ms
19,496 KB
testcase_25 AC 70 ms
10,352 KB
testcase_26 AC 120 ms
12,708 KB
testcase_27 AC 281 ms
19,116 KB
testcase_28 AC 175 ms
14,600 KB
testcase_29 AC 331 ms
21,316 KB
testcase_30 AC 63 ms
10,108 KB
testcase_31 AC 38 ms
8,992 KB
testcase_32 AC 81 ms
10,768 KB
testcase_33 AC 261 ms
18,616 KB
testcase_34 AC 42 ms
9,216 KB
testcase_35 AC 116 ms
12,364 KB
testcase_36 AC 130 ms
13,204 KB
testcase_37 AC 317 ms
20,716 KB
testcase_38 AC 221 ms
16,832 KB
testcase_39 AC 36 ms
8,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(m)]
ab.sort(key=lambda x: x[1])
i = 1; count = 0
for a, b in ab:
    if i <= a: i = b; count += 1
print(2*(n-1)-count)
0