84132024-01-15 17:27:25birozsMekk Mester munkái (50 pont)python3Wrong answer 7/50578ms69600 KiB
'''
be = open("be2.txt")
N,H = map(int,be.readline().split())
lista = []
for i in range(N):
    tol,ig = map(int,be.readline().split())
    lista.append([tol,ig,i+1,0])
be.close()
'''
N,H = map(int,input().split())
lista = []
for i in range(N):
    tol,ig = map(int,input().split())
    lista.append([tol,ig,i+1,0])
lista.sort(key=lambda x:(x[1],x[0]))
if N == 1:
    print(1,0)
    print(1)
    print()
elif N == 2:
    print(1,1)
    print(1)
    print(1)
else:
    Mester = [lista[0][2]]
    Fia = [lista[1][2]]
    Mvege = lista[0][1]
    Fvege = lista[1][1]
    for i in range(2,N):
        if lista[i][0] > Mvege:
            lista[i][3] = 1
            Mvege = lista[i][1]
            Mester.append(lista[i][2])
    for i in range(2,N):
        if lista[i][0] > Fvege and lista[i][3] == 0:
            Fvege = lista[i][1]
            Fia.append(lista[i][2])
print(len(Mester),len(Fia))
for x in Mester:
    print(x,end=" ")
print()
for x in Fia:
    print(x,end=" ")
SubtaskSumTestVerdictTimeMemory
base7/50
1Accepted0/017ms11692 KiB
2Wrong answer0/052ms17496 KiB
3Accepted1/117ms12152 KiB
4Accepted1/117ms12416 KiB
5Wrong answer0/217ms12516 KiB
6Wrong answer0/217ms12808 KiB
7Accepted2/217ms12784 KiB
8Wrong answer0/217ms13024 KiB
9Accepted3/317ms13072 KiB
10Wrong answer0/120ms13492 KiB
11Wrong answer0/120ms13560 KiB
12Wrong answer0/221ms13568 KiB
13Wrong answer0/221ms13896 KiB
14Wrong answer0/221ms13792 KiB
15Wrong answer0/224ms14240 KiB
16Wrong answer0/323ms14328 KiB
17Wrong answer0/2472ms68548 KiB
18Wrong answer0/2544ms68764 KiB
19Wrong answer0/4546ms69052 KiB
20Wrong answer0/4555ms69104 KiB
21Wrong answer0/4542ms69256 KiB
22Wrong answer0/4486ms69600 KiB
23Wrong answer0/4578ms69264 KiB