結果

問題 No.1995 CHIKA Road
ユーザー shobonvipshobonvip
提出日時 2022-07-01 22:14:15
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 470 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 88,344 KB
最終ジャッジ日時 2023-08-17 09:44:53
合計ジャッジ時間 12,484 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,240 KB
testcase_01 AC 77 ms
71,364 KB
testcase_02 AC 73 ms
71,388 KB
testcase_03 AC 77 ms
71,400 KB
testcase_04 AC 74 ms
71,424 KB
testcase_05 AC 75 ms
71,480 KB
testcase_06 AC 120 ms
78,016 KB
testcase_07 AC 176 ms
80,568 KB
testcase_08 AC 78 ms
71,540 KB
testcase_09 AC 78 ms
71,588 KB
testcase_10 AC 428 ms
88,336 KB
testcase_11 AC 431 ms
87,524 KB
testcase_12 AC 470 ms
87,708 KB
testcase_13 AC 205 ms
81,424 KB
testcase_14 AC 227 ms
81,648 KB
testcase_15 AC 411 ms
86,852 KB
testcase_16 AC 144 ms
78,660 KB
testcase_17 AC 299 ms
84,052 KB
testcase_18 AC 418 ms
88,312 KB
testcase_19 AC 421 ms
88,344 KB
testcase_20 AC 259 ms
83,288 KB
testcase_21 AC 236 ms
82,356 KB
testcase_22 AC 393 ms
88,076 KB
testcase_23 AC 179 ms
80,904 KB
testcase_24 AC 349 ms
86,676 KB
testcase_25 AC 144 ms
79,216 KB
testcase_26 AC 202 ms
81,564 KB
testcase_27 AC 341 ms
85,624 KB
testcase_28 AC 239 ms
82,520 KB
testcase_29 AC 408 ms
88,256 KB
testcase_30 AC 138 ms
78,840 KB
testcase_31 AC 120 ms
78,164 KB
testcase_32 AC 159 ms
79,576 KB
testcase_33 AC 334 ms
85,444 KB
testcase_34 AC 118 ms
77,792 KB
testcase_35 AC 191 ms
81,436 KB
testcase_36 AC 211 ms
82,008 KB
testcase_37 AC 402 ms
87,760 KB
testcase_38 AC 297 ms
84,312 KB
testcase_39 AC 118 ms
77,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# スケジューリング問題のやつ
# 答え 2*(N-1) - [スケジューリング]

n, m = map(int,input().split())
dat = []
for i in range(m):
	a, b = map(int,input().split())
	dat.append((a, b))

dat.sort(key= lambda x:(x[1], x[0]))

now = 0
tmp = 0
for i in range(m):
	if now <= dat[i][0]:
		tmp += 1
		now = dat[i][1]

print(2*(n-1) - tmp)
0