結果

問題 No.2796 Small Matryoshka
ユーザー scarlet-Chun-DHscarlet-Chun-DH
提出日時 2024-06-28 22:54:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 116,352 KB
最終ジャッジ日時 2024-06-28 22:54:31
合計ジャッジ時間 5,713 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
57,216 KB
testcase_01 WA -
testcase_02 AC 34 ms
51,712 KB
testcase_03 AC 34 ms
51,584 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin

n = int(stdin.readline())

matryoshka_list = [list(map(int, stdin.readline().split())) for _ in range(n)]

matryoshka_list = sorted(matryoshka_list, reverse=True, key=lambda x: (x[1],x[0]))

res = 0

while len(matryoshka_list) > 1:
	r_in = matryoshka_list[-1][1]
	for i in range(len(matryoshka_list)-2, -1, -1):
		if r_in <= matryoshka_list[i][0]:
			del matryoshka_list[-1]
			break
	res += 1
	del matryoshka_list[-1]

print(res)
0