88552024-02-02 14:34:57petergalambosMekk Mester munkái (50 pont)python3Wrong answer 6/50529ms55696 KiB
N, H = [int(i) for i in input().split()]
M = [[] for i in range(N)]
K1 = []
K2 = []
for i in range(N):
    k,v = [int(i) for i in input().split()]
    M[i] = [v,k,i+1]

M.sort()

K2 = [M[0]]
R1 = 0
R2 = M[0][0]
elso = True
for m in M[1:]:
    if elso:
        if m[1] > R1:
            K1.append(m)
            R1 = m[0]
            elso = True
        elif m[1] > R2:
            K2.append(m)
            R2 = m[0]
            elso = False
    else:
        if m[1] > R2:
            K2.append(m)
            R2 = m[0]
            elso = True
        elif m[1] > R1:
            K1.append(m)
            R1 = m[0]
            elso = True

print(len(K1),len(K2))
print(*[i[-1] for i in K1])
print(*[i[-1] for i in K2])
SubtaskSumTestVerdictTimeMemory
base6/50
1Accepted0/018ms11144 KiB
2Wrong answer0/052ms15960 KiB
3Accepted1/117ms11984 KiB
4Wrong answer0/118ms12032 KiB
5Accepted2/218ms12192 KiB
6Wrong answer0/218ms12208 KiB
7Wrong answer0/218ms12592 KiB
8Wrong answer0/218ms12656 KiB
9Wrong answer0/318ms12808 KiB
10Wrong answer0/121ms13284 KiB
11Accepted1/120ms13544 KiB
12Accepted2/221ms13516 KiB
13Wrong answer0/221ms13848 KiB
14Wrong answer0/221ms13552 KiB
15Wrong answer0/221ms13640 KiB
16Wrong answer0/321ms14016 KiB
17Wrong answer0/2460ms54588 KiB
18Wrong answer0/2505ms54768 KiB
19Wrong answer0/4504ms54668 KiB
20Wrong answer0/4455ms54848 KiB
21Wrong answer0/4509ms54592 KiB
22Wrong answer0/4460ms54932 KiB
23Wrong answer0/4529ms55696 KiB