結果

問題 No.1995 CHIKA Road
ユーザー MasKoaTSMasKoaTS
提出日時 2022-02-19 00:03:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 399 ms / 2,000 ms
コード長 257 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,632 KB
実行使用メモリ 23,928 KB
最終ジャッジ日時 2023-09-17 05:08:36
合計ジャッジ時間 7,773 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,924 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 16 ms
7,736 KB
testcase_03 AC 15 ms
7,704 KB
testcase_04 AC 16 ms
7,820 KB
testcase_05 AC 16 ms
7,780 KB
testcase_06 AC 32 ms
9,388 KB
testcase_07 AC 82 ms
12,204 KB
testcase_08 AC 16 ms
7,752 KB
testcase_09 AC 16 ms
7,940 KB
testcase_10 AC 325 ms
20,224 KB
testcase_11 AC 349 ms
23,860 KB
testcase_12 AC 399 ms
23,928 KB
testcase_13 AC 99 ms
13,480 KB
testcase_14 AC 103 ms
13,692 KB
testcase_15 AC 315 ms
22,196 KB
testcase_16 AC 45 ms
10,024 KB
testcase_17 AC 191 ms
16,832 KB
testcase_18 AC 357 ms
22,328 KB
testcase_19 AC 364 ms
22,408 KB
testcase_20 AC 164 ms
15,824 KB
testcase_21 AC 152 ms
15,076 KB
testcase_22 AC 333 ms
21,592 KB
testcase_23 AC 88 ms
12,316 KB
testcase_24 AC 286 ms
20,228 KB
testcase_25 AC 55 ms
10,284 KB
testcase_26 AC 103 ms
12,852 KB
testcase_27 AC 280 ms
19,816 KB
testcase_28 AC 152 ms
15,072 KB
testcase_29 AC 350 ms
21,936 KB
testcase_30 AC 51 ms
10,352 KB
testcase_31 AC 31 ms
9,164 KB
testcase_32 AC 67 ms
10,996 KB
testcase_33 AC 257 ms
19,324 KB
testcase_34 AC 33 ms
9,348 KB
testcase_35 AC 95 ms
12,756 KB
testcase_36 AC 114 ms
13,596 KB
testcase_37 AC 329 ms
21,248 KB
testcase_38 AC 215 ms
17,344 KB
testcase_39 AC 30 ms
9,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

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