結果

問題 No.1995 CHIKA Road
ユーザー MasKoaTSMasKoaTS
提出日時 2022-02-18 13:44:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 207 ms / 2,000 ms
コード長 274 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 29,880 KB
最終ジャッジ日時 2023-09-17 05:08:20
合計ジャッジ時間 5,190 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,816 KB
testcase_01 AC 13 ms
7,960 KB
testcase_02 AC 14 ms
7,836 KB
testcase_03 AC 14 ms
7,760 KB
testcase_04 AC 14 ms
7,788 KB
testcase_05 AC 15 ms
7,824 KB
testcase_06 AC 29 ms
9,928 KB
testcase_07 AC 60 ms
13,888 KB
testcase_08 AC 15 ms
7,788 KB
testcase_09 AC 14 ms
7,828 KB
testcase_10 AC 186 ms
26,276 KB
testcase_11 AC 199 ms
29,880 KB
testcase_12 AC 147 ms
29,316 KB
testcase_13 AC 68 ms
15,228 KB
testcase_14 AC 69 ms
15,596 KB
testcase_15 AC 183 ms
27,304 KB
testcase_16 AC 36 ms
10,956 KB
testcase_17 AC 113 ms
20,368 KB
testcase_18 AC 200 ms
28,508 KB
testcase_19 AC 207 ms
28,464 KB
testcase_20 AC 103 ms
19,092 KB
testcase_21 AC 95 ms
17,892 KB
testcase_22 AC 189 ms
27,304 KB
testcase_23 AC 59 ms
14,032 KB
testcase_24 AC 179 ms
24,864 KB
testcase_25 AC 51 ms
11,476 KB
testcase_26 AC 68 ms
14,784 KB
testcase_27 AC 159 ms
24,272 KB
testcase_28 AC 98 ms
17,892 KB
testcase_29 AC 203 ms
28,064 KB
testcase_30 AC 37 ms
11,376 KB
testcase_31 AC 24 ms
9,520 KB
testcase_32 AC 47 ms
12,216 KB
testcase_33 AC 155 ms
23,812 KB
testcase_34 AC 26 ms
9,984 KB
testcase_35 AC 65 ms
14,496 KB
testcase_36 AC 77 ms
15,612 KB
testcase_37 AC 189 ms
26,696 KB
testcase_38 AC 120 ms
21,188 KB
testcase_39 AC 24 ms
9,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
INF = 10 ** 18

n, m = map(int,input().split())
plan = sorted([list(map(int,input().split())) for _ in [0] * m], key = lambda x : x[1])

now = 0
ans = 2 * (n - 1)
for l, r in plan:
	if(now > l):
		continue
	now = r
	ans -= 1
print(ans)
0