結果

問題 No.1995 CHIKA Road
ユーザー ShirotsumeShirotsume
提出日時 2022-07-01 22:15:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 262 ms / 2,000 ms
コード長 360 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 91,272 KB
最終ジャッジ日時 2023-08-17 09:46:37
合計ジャッジ時間 8,095 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,624 KB
testcase_01 AC 70 ms
71,368 KB
testcase_02 AC 71 ms
71,348 KB
testcase_03 AC 72 ms
71,264 KB
testcase_04 AC 72 ms
71,228 KB
testcase_05 AC 72 ms
71,528 KB
testcase_06 AC 100 ms
78,148 KB
testcase_07 AC 128 ms
80,280 KB
testcase_08 AC 73 ms
71,348 KB
testcase_09 AC 72 ms
71,380 KB
testcase_10 AC 220 ms
87,268 KB
testcase_11 AC 262 ms
91,272 KB
testcase_12 AC 163 ms
90,472 KB
testcase_13 AC 137 ms
80,204 KB
testcase_14 AC 141 ms
80,356 KB
testcase_15 AC 225 ms
86,520 KB
testcase_16 AC 104 ms
78,316 KB
testcase_17 AC 178 ms
82,728 KB
testcase_18 AC 244 ms
87,208 KB
testcase_19 AC 242 ms
87,204 KB
testcase_20 AC 167 ms
82,268 KB
testcase_21 AC 160 ms
82,308 KB
testcase_22 AC 233 ms
87,116 KB
testcase_23 AC 129 ms
80,272 KB
testcase_24 AC 225 ms
86,512 KB
testcase_25 AC 110 ms
78,308 KB
testcase_26 AC 137 ms
80,188 KB
testcase_27 AC 212 ms
84,916 KB
testcase_28 AC 159 ms
82,484 KB
testcase_29 AC 243 ms
87,156 KB
testcase_30 AC 107 ms
78,164 KB
testcase_31 AC 93 ms
76,780 KB
testcase_32 AC 114 ms
78,332 KB
testcase_33 AC 206 ms
85,088 KB
testcase_34 AC 97 ms
78,072 KB
testcase_35 AC 131 ms
80,144 KB
testcase_36 AC 142 ms
80,412 KB
testcase_37 AC 240 ms
87,168 KB
testcase_38 AC 190 ms
84,252 KB
testcase_39 AC 94 ms
76,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
INF = 2 ** 63 - 1
mod = 998244353
n, m = mi()
ab = [li() for _ in range(m)]

ab.sort(key = lambda x: x[1])

now = 1
cnt = 0
for a, b in ab:
    if now <= a:
        now = b
        cnt += 1
print(2 * (n - 1) - cnt)
0