88542024-02-02 14:32:42petergalambosMekk Mester munkái (50 pont)python3Wrong answer 38/50513ms57032 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 = False
        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
base38/50
1Accepted0/018ms11136 KiB
2Accepted0/054ms16008 KiB
3Accepted1/118ms11812 KiB
4Accepted1/118ms12160 KiB
5Accepted2/217ms12408 KiB
6Accepted2/218ms12620 KiB
7Accepted2/218ms12876 KiB
8Wrong answer0/218ms13156 KiB
9Accepted3/317ms13152 KiB
10Accepted1/121ms13428 KiB
11Accepted1/120ms13476 KiB
12Accepted2/220ms13532 KiB
13Accepted2/220ms13476 KiB
14Accepted2/220ms13508 KiB
15Wrong answer0/221ms13656 KiB
16Accepted3/321ms13580 KiB
17Accepted2/2449ms54568 KiB
18Accepted2/2451ms54552 KiB
19Wrong answer0/4500ms54536 KiB
20Wrong answer0/4449ms55092 KiB
21Accepted4/4507ms54896 KiB
22Accepted4/4460ms55156 KiB
23Accepted4/4513ms57032 KiB