結果

問題 No.1995 CHIKA Road
ユーザー googol_S0googol_S0
提出日時 2022-07-01 21:54:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 252 ms / 2,000 ms
コード長 195 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 89,228 KB
最終ジャッジ日時 2023-08-17 09:28:04
合計ジャッジ時間 8,102 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,500 KB
testcase_01 AC 66 ms
71,132 KB
testcase_02 AC 66 ms
71,272 KB
testcase_03 AC 66 ms
71,184 KB
testcase_04 AC 66 ms
71,080 KB
testcase_05 AC 67 ms
71,328 KB
testcase_06 AC 101 ms
78,024 KB
testcase_07 AC 132 ms
79,684 KB
testcase_08 AC 69 ms
71,472 KB
testcase_09 AC 69 ms
71,272 KB
testcase_10 AC 224 ms
86,796 KB
testcase_11 AC 252 ms
86,164 KB
testcase_12 AC 164 ms
85,484 KB
testcase_13 AC 138 ms
79,680 KB
testcase_14 AC 143 ms
79,832 KB
testcase_15 AC 230 ms
85,016 KB
testcase_16 AC 109 ms
77,876 KB
testcase_17 AC 182 ms
83,124 KB
testcase_18 AC 252 ms
86,880 KB
testcase_19 AC 251 ms
86,808 KB
testcase_20 AC 174 ms
81,680 KB
testcase_21 AC 168 ms
81,296 KB
testcase_22 AC 250 ms
89,228 KB
testcase_23 AC 135 ms
79,680 KB
testcase_24 AC 225 ms
85,104 KB
testcase_25 AC 117 ms
78,016 KB
testcase_26 AC 140 ms
79,524 KB
testcase_27 AC 217 ms
85,084 KB
testcase_28 AC 166 ms
81,436 KB
testcase_29 AC 247 ms
86,828 KB
testcase_30 AC 113 ms
78,040 KB
testcase_31 AC 101 ms
78,008 KB
testcase_32 AC 120 ms
78,212 KB
testcase_33 AC 221 ms
86,216 KB
testcase_34 AC 103 ms
78,072 KB
testcase_35 AC 137 ms
79,612 KB
testcase_36 AC 145 ms
79,624 KB
testcase_37 AC 242 ms
85,352 KB
testcase_38 AC 190 ms
83,140 KB
testcase_39 AC 100 ms
78,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
X=[tuple(map(int,input().split())) for i in range(M)]
X.sort(key=lambda x:x[1])
ANS=2*N-2
v=0
for i in range(M):
  if v<=X[i][0]:
    v=X[i][1]
    ANS-=1
print(ANS)
0