ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1203. Scientific Conference

WA 4
Posted by Tolchev Evgeny 25 Nov 2022 03:00
n = int(input())
m = []
SIZE = 30001
result = [0] * SIZE
for i in range(n):
    m.append(list(map(int,input().split())))
m.sort(key = lambda x: x[1])
for i in range(n):
    start = m[i][0]
    end = m[i][1]
    fail = 0
    for j in range(start):
        fail = max(fail,result[j])
    result[end] = fail + 1
maxn = 0
for i in range(SIZE):
    maxn = max(maxn, result[i])
print(maxn)

what`s wrong ?

Edited by author 25.11.2022 03:04

Edited by author 25.11.2022 03:04