結果

問題 No.1995 CHIKA Road
ユーザー trineutrontrineutron
提出日時 2022-07-01 21:36:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 346 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 23,712 KB
最終ジャッジ日時 2023-08-17 08:59:25
合計ジャッジ時間 8,102 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,848 KB
testcase_01 AC 14 ms
7,796 KB
testcase_02 AC 14 ms
7,864 KB
testcase_03 AC 15 ms
7,936 KB
testcase_04 AC 14 ms
7,792 KB
testcase_05 AC 15 ms
7,824 KB
testcase_06 AC 40 ms
9,316 KB
testcase_07 AC 102 ms
12,000 KB
testcase_08 AC 16 ms
7,872 KB
testcase_09 AC 15 ms
7,776 KB
testcase_10 AC 325 ms
19,924 KB
testcase_11 AC 341 ms
23,712 KB
testcase_12 AC 307 ms
22,748 KB
testcase_13 AC 122 ms
13,404 KB
testcase_14 AC 125 ms
13,628 KB
testcase_15 AC 295 ms
22,024 KB
testcase_16 AC 58 ms
9,964 KB
testcase_17 AC 206 ms
16,572 KB
testcase_18 AC 344 ms
22,600 KB
testcase_19 AC 346 ms
22,424 KB
testcase_20 AC 189 ms
16,100 KB
testcase_21 AC 172 ms
15,064 KB
testcase_22 AC 325 ms
21,888 KB
testcase_23 AC 109 ms
12,280 KB
testcase_24 AC 284 ms
20,332 KB
testcase_25 AC 71 ms
10,416 KB
testcase_26 AC 123 ms
12,936 KB
testcase_27 AC 272 ms
19,684 KB
testcase_28 AC 174 ms
15,016 KB
testcase_29 AC 330 ms
22,096 KB
testcase_30 AC 64 ms
10,232 KB
testcase_31 AC 38 ms
9,096 KB
testcase_32 AC 81 ms
11,008 KB
testcase_33 AC 269 ms
19,112 KB
testcase_34 AC 42 ms
9,256 KB
testcase_35 AC 117 ms
12,564 KB
testcase_36 AC 133 ms
13,596 KB
testcase_37 AC 322 ms
21,396 KB
testcase_38 AC 223 ms
17,372 KB
testcase_39 AC 38 ms
9,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
segs = [None] * m
for i in range(m):
    segs[i] = tuple(map(int, input().split()))
segs = sorted(segs, key=lambda x: x[1])
ans = 0
r = -1
for seg in segs:
    if r <= seg[0]:
        ans += 1
        r = seg[1]
print(2 * n - 2 - ans)
0