結果

問題 No.1995 CHIKA Road
ユーザー lilictakalilictaka
提出日時 2022-07-01 22:22:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 262 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 84,368 KB
最終ジャッジ日時 2023-08-17 09:52:47
合計ジャッジ時間 8,276 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,172 KB
testcase_01 AC 73 ms
71,436 KB
testcase_02 AC 73 ms
71,364 KB
testcase_03 AC 72 ms
71,516 KB
testcase_04 AC 73 ms
71,120 KB
testcase_05 AC 74 ms
71,268 KB
testcase_06 AC 106 ms
78,028 KB
testcase_07 AC 135 ms
78,452 KB
testcase_08 AC 73 ms
71,364 KB
testcase_09 AC 73 ms
71,356 KB
testcase_10 AC 221 ms
82,756 KB
testcase_11 AC 262 ms
84,368 KB
testcase_12 AC 168 ms
83,980 KB
testcase_13 AC 143 ms
79,256 KB
testcase_14 AC 146 ms
79,136 KB
testcase_15 AC 230 ms
82,168 KB
testcase_16 AC 115 ms
77,440 KB
testcase_17 AC 186 ms
80,692 KB
testcase_18 AC 245 ms
82,548 KB
testcase_19 AC 245 ms
82,516 KB
testcase_20 AC 172 ms
80,604 KB
testcase_21 AC 167 ms
80,308 KB
testcase_22 AC 239 ms
82,444 KB
testcase_23 AC 136 ms
78,772 KB
testcase_24 AC 220 ms
82,240 KB
testcase_25 AC 121 ms
77,916 KB
testcase_26 AC 144 ms
78,972 KB
testcase_27 AC 216 ms
82,052 KB
testcase_28 AC 166 ms
80,468 KB
testcase_29 AC 249 ms
82,528 KB
testcase_30 AC 119 ms
77,868 KB
testcase_31 AC 107 ms
77,804 KB
testcase_32 AC 125 ms
78,428 KB
testcase_33 AC 212 ms
82,040 KB
testcase_34 AC 107 ms
77,648 KB
testcase_35 AC 138 ms
78,776 KB
testcase_36 AC 150 ms
80,264 KB
testcase_37 AC 236 ms
82,544 KB
testcase_38 AC 188 ms
80,480 KB
testcase_39 AC 109 ms
77,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
board = []
for _ in range(M):
    a,b = map(int,input().split())
    board.append((a,b))
board.sort(key=lambda x:x[1])
cnt = 0
lastr = 0
for l,r in board:
    if lastr <= l:
        cnt += 1
        lastr = r
ans = 2 * (N-1) -cnt
print(ans)
0