結果

問題 No.1995 CHIKA Road
ユーザー shobonvipshobonvip
提出日時 2022-07-01 22:14:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 348 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 87,260 KB
最終ジャッジ日時 2024-05-04 16:35:15
合計ジャッジ時間 8,258 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
51,968 KB
testcase_01 AC 31 ms
51,456 KB
testcase_02 AC 37 ms
52,352 KB
testcase_03 AC 34 ms
52,480 KB
testcase_04 AC 34 ms
52,608 KB
testcase_05 AC 33 ms
52,864 KB
testcase_06 AC 80 ms
77,056 KB
testcase_07 AC 130 ms
79,488 KB
testcase_08 AC 37 ms
52,992 KB
testcase_09 AC 37 ms
52,864 KB
testcase_10 AC 331 ms
86,680 KB
testcase_11 AC 327 ms
86,228 KB
testcase_12 AC 332 ms
86,224 KB
testcase_13 AC 138 ms
80,256 KB
testcase_14 AC 141 ms
80,000 KB
testcase_15 AC 289 ms
85,708 KB
testcase_16 AC 93 ms
77,568 KB
testcase_17 AC 215 ms
82,688 KB
testcase_18 AC 337 ms
86,740 KB
testcase_19 AC 348 ms
87,128 KB
testcase_20 AC 197 ms
82,176 KB
testcase_21 AC 180 ms
80,896 KB
testcase_22 AC 313 ms
86,876 KB
testcase_23 AC 125 ms
79,616 KB
testcase_24 AC 275 ms
85,604 KB
testcase_25 AC 94 ms
77,824 KB
testcase_26 AC 136 ms
80,384 KB
testcase_27 AC 268 ms
84,328 KB
testcase_28 AC 180 ms
81,408 KB
testcase_29 AC 318 ms
87,260 KB
testcase_30 AC 91 ms
77,824 KB
testcase_31 AC 74 ms
76,800 KB
testcase_32 AC 104 ms
78,276 KB
testcase_33 AC 263 ms
84,152 KB
testcase_34 AC 74 ms
77,056 KB
testcase_35 AC 133 ms
80,000 KB
testcase_36 AC 151 ms
81,024 KB
testcase_37 AC 310 ms
86,632 KB
testcase_38 AC 221 ms
82,816 KB
testcase_39 AC 71 ms
77,184 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