結果

問題 No.1995 CHIKA Road
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-07-01 22:04:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 430 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 434 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 88,384 KB
最終ジャッジ日時 2023-08-17 09:37:29
合計ジャッジ時間 11,233 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,292 KB
testcase_01 AC 73 ms
71,296 KB
testcase_02 AC 72 ms
71,340 KB
testcase_03 AC 73 ms
71,160 KB
testcase_04 AC 75 ms
71,272 KB
testcase_05 AC 74 ms
71,164 KB
testcase_06 AC 114 ms
78,028 KB
testcase_07 AC 176 ms
80,528 KB
testcase_08 AC 76 ms
71,672 KB
testcase_09 AC 78 ms
71,356 KB
testcase_10 AC 427 ms
88,236 KB
testcase_11 AC 418 ms
87,648 KB
testcase_12 AC 430 ms
87,652 KB
testcase_13 AC 192 ms
81,592 KB
testcase_14 AC 196 ms
81,436 KB
testcase_15 AC 374 ms
87,084 KB
testcase_16 AC 131 ms
78,612 KB
testcase_17 AC 280 ms
84,016 KB
testcase_18 AC 423 ms
88,384 KB
testcase_19 AC 421 ms
88,268 KB
testcase_20 AC 260 ms
83,204 KB
testcase_21 AC 237 ms
82,488 KB
testcase_22 AC 397 ms
87,616 KB
testcase_23 AC 180 ms
80,928 KB
testcase_24 AC 353 ms
86,876 KB
testcase_25 AC 141 ms
79,124 KB
testcase_26 AC 194 ms
81,464 KB
testcase_27 AC 336 ms
85,580 KB
testcase_28 AC 237 ms
82,396 KB
testcase_29 AC 404 ms
88,012 KB
testcase_30 AC 138 ms
79,044 KB
testcase_31 AC 118 ms
78,184 KB
testcase_32 AC 156 ms
79,692 KB
testcase_33 AC 337 ms
85,580 KB
testcase_34 AC 116 ms
77,752 KB
testcase_35 AC 190 ms
81,188 KB
testcase_36 AC 208 ms
81,900 KB
testcase_37 AC 402 ms
87,448 KB
testcase_38 AC 293 ms
84,000 KB
testcase_39 AC 113 ms
78,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
l = []
for i in range(m):
    a,b = map(int,input().split())
    l.append((a,b))
l.sort(key = lambda x:(x[1],x[0]))
res = 0
right = 0
for a,b in l:
    if a >=right:
        res += 1
        right = b
print(2*(n-1)-res)
0