70分 TLE了求调
查看原帖
70分 TLE了求调
1116370
42211062nnnan楼主2025/2/3 14:17
n = int(input())
a = []
for i in range(n):
    temp = list(map(int, input().split()))
    a.append(temp)

a.sort(key= lambda x: (x[1], x[0]))
count = 0
now = 0
for i, j in a:
    if i >= now:
        count =count +1
        now = j

print(count)
2025/2/3 14:17
加载中...