結果

問題 No.1995 CHIKA Road
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-07-01 21:57:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 287 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 90,984 KB
最終ジャッジ日時 2023-08-17 09:31:36
合計ジャッジ時間 8,810 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,304 KB
testcase_01 AC 74 ms
71,180 KB
testcase_02 AC 74 ms
71,344 KB
testcase_03 AC 73 ms
71,472 KB
testcase_04 AC 76 ms
71,412 KB
testcase_05 AC 74 ms
71,344 KB
testcase_06 AC 115 ms
77,968 KB
testcase_07 AC 146 ms
79,884 KB
testcase_08 AC 78 ms
71,172 KB
testcase_09 AC 75 ms
71,268 KB
testcase_10 AC 252 ms
88,328 KB
testcase_11 AC 282 ms
87,572 KB
testcase_12 AC 188 ms
87,100 KB
testcase_13 AC 154 ms
80,008 KB
testcase_14 AC 159 ms
79,852 KB
testcase_15 AC 257 ms
86,140 KB
testcase_16 AC 125 ms
77,916 KB
testcase_17 AC 207 ms
83,952 KB
testcase_18 AC 282 ms
88,268 KB
testcase_19 AC 285 ms
88,432 KB
testcase_20 AC 194 ms
82,204 KB
testcase_21 AC 185 ms
82,048 KB
testcase_22 AC 287 ms
90,984 KB
testcase_23 AC 149 ms
79,988 KB
testcase_24 AC 248 ms
86,148 KB
testcase_25 AC 127 ms
78,176 KB
testcase_26 AC 155 ms
79,992 KB
testcase_27 AC 243 ms
86,088 KB
testcase_28 AC 186 ms
82,040 KB
testcase_29 AC 272 ms
88,380 KB
testcase_30 AC 123 ms
78,104 KB
testcase_31 AC 110 ms
78,116 KB
testcase_32 AC 137 ms
79,656 KB
testcase_33 AC 246 ms
86,680 KB
testcase_34 AC 112 ms
77,972 KB
testcase_35 AC 152 ms
79,856 KB
testcase_36 AC 160 ms
80,136 KB
testcase_37 AC 272 ms
88,024 KB
testcase_38 AC 212 ms
84,132 KB
testcase_39 AC 112 ms
78,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
AB = [list(map(int,input().split())) for i in range(m)]
ans = 0
AB.sort(key=lambda x: x[1])
now = 0
for a,b in AB:
    if now <= a:
        now = b
        ans += 1
print(2*(n-1)-ans)
0