結果

問題 No.1995 CHIKA Road
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-07-01 22:04:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 437 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 374 ms
コンパイル使用メモリ 82,792 KB
実行使用メモリ 87,512 KB
最終ジャッジ日時 2024-05-04 16:28:49
合計ジャッジ時間 10,349 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,096 KB
testcase_01 AC 39 ms
51,456 KB
testcase_02 AC 39 ms
51,968 KB
testcase_03 AC 39 ms
51,584 KB
testcase_04 AC 41 ms
52,352 KB
testcase_05 AC 43 ms
52,608 KB
testcase_06 AC 98 ms
76,928 KB
testcase_07 AC 161 ms
79,488 KB
testcase_08 AC 46 ms
53,248 KB
testcase_09 AC 42 ms
52,760 KB
testcase_10 AC 432 ms
87,316 KB
testcase_11 AC 425 ms
86,224 KB
testcase_12 AC 437 ms
86,228 KB
testcase_13 AC 179 ms
80,128 KB
testcase_14 AC 176 ms
80,384 KB
testcase_15 AC 371 ms
85,832 KB
testcase_16 AC 112 ms
77,436 KB
testcase_17 AC 280 ms
82,688 KB
testcase_18 AC 422 ms
87,512 KB
testcase_19 AC 422 ms
87,016 KB
testcase_20 AC 241 ms
82,132 KB
testcase_21 AC 219 ms
81,408 KB
testcase_22 AC 398 ms
86,496 KB
testcase_23 AC 164 ms
79,488 KB
testcase_24 AC 366 ms
85,088 KB
testcase_25 AC 127 ms
78,080 KB
testcase_26 AC 185 ms
80,128 KB
testcase_27 AC 342 ms
84,092 KB
testcase_28 AC 231 ms
81,152 KB
testcase_29 AC 415 ms
86,880 KB
testcase_30 AC 120 ms
77,492 KB
testcase_31 AC 101 ms
76,736 KB
testcase_32 AC 144 ms
78,336 KB
testcase_33 AC 334 ms
84,140 KB
testcase_34 AC 100 ms
77,056 KB
testcase_35 AC 181 ms
79,872 KB
testcase_36 AC 200 ms
80,776 KB
testcase_37 AC 404 ms
86,108 KB
testcase_38 AC 292 ms
83,200 KB
testcase_39 AC 97 ms
76,800 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