結果

問題 No.1995 CHIKA Road
ユーザー 👑 H20H20
提出日時 2022-07-01 22:07:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 259 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 589 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 91,504 KB
最終ジャッジ日時 2023-08-17 09:39:52
合計ジャッジ時間 8,143 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,420 KB
testcase_01 AC 65 ms
71,264 KB
testcase_02 AC 67 ms
71,320 KB
testcase_03 AC 65 ms
70,984 KB
testcase_04 AC 67 ms
71,328 KB
testcase_05 AC 67 ms
71,528 KB
testcase_06 AC 103 ms
78,004 KB
testcase_07 AC 130 ms
79,832 KB
testcase_08 AC 68 ms
71,228 KB
testcase_09 AC 67 ms
71,416 KB
testcase_10 AC 222 ms
89,128 KB
testcase_11 AC 249 ms
88,560 KB
testcase_12 AC 166 ms
87,932 KB
testcase_13 AC 139 ms
80,188 KB
testcase_14 AC 143 ms
80,216 KB
testcase_15 AC 225 ms
86,800 KB
testcase_16 AC 111 ms
77,784 KB
testcase_17 AC 180 ms
84,404 KB
testcase_18 AC 247 ms
89,064 KB
testcase_19 AC 247 ms
89,104 KB
testcase_20 AC 174 ms
82,312 KB
testcase_21 AC 166 ms
82,304 KB
testcase_22 AC 259 ms
91,504 KB
testcase_23 AC 135 ms
79,900 KB
testcase_24 AC 239 ms
86,956 KB
testcase_25 AC 116 ms
78,096 KB
testcase_26 AC 140 ms
80,364 KB
testcase_27 AC 217 ms
87,168 KB
testcase_28 AC 166 ms
82,144 KB
testcase_29 AC 246 ms
88,952 KB
testcase_30 AC 121 ms
78,008 KB
testcase_31 AC 103 ms
77,732 KB
testcase_32 AC 122 ms
79,824 KB
testcase_33 AC 219 ms
87,204 KB
testcase_34 AC 104 ms
77,840 KB
testcase_35 AC 141 ms
80,224 KB
testcase_36 AC 146 ms
80,308 KB
testcase_37 AC 243 ms
88,756 KB
testcase_38 AC 187 ms
84,448 KB
testcase_39 AC 106 ms
77,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(M)]
AB = sorted(AB, key=lambda x: x[1])
v = 0
ans = 2*N-2
for a,b in AB:
    if v<=a:
        ans-=1
        v=b
print(ans)
0