88572024-02-02 15:04:29kristofMekk Mester munkái (50 pont)python3Wrong answer 0/50546ms76204 KiB
megrendelesekSzama, napokSzama = (int(i) for i in input().split()) 
rendelesek = []

for i in range(megrendelesekSzama):
    asd = list(map(int, input().split()))
    asd.append(i+1)
    rendelesek.append(asd)

rendelesek.sort(key=lambda x: (x[1], x[0]))

mekkUtolso = 0
fiaUtolso = 0
mekkL = []
fiaL = []

for value in rendelesek:
    if fiaUtolso>mekkUtolso:

        if fiaUtolso < value[0]:
            fiaUtolso = value[1]
            fiaL.append(str(value[2]))
            #print("fia", value, i)
        elif mekkUtolso < value[0]:
            mekkUtolsao = value[1]
            mekkL.append(str(value[2]))
            #print("apa", value, i)
    else:
        if mekkUtolso < value[0]:
            mekkUtolso = value[1]
            mekkL.append(str(value[2]))
            #print("apa", value, i)
        elif fiaUtolso < value[0]:
            fiaUtolso = value[1]
            fiaL.append(str(value[2]))
            #print("fia", value, i)


print(len(mekkL), len(fiaL))
print(" ".join(mekkL))
print(" ".join(fiaL))
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/017ms11204 KiB
2Wrong answer0/059ms18124 KiB
3Wrong answer0/117ms11964 KiB
4Wrong answer0/119ms12420 KiB
5Wrong answer0/218ms12392 KiB
6Wrong answer0/218ms12792 KiB
7Wrong answer0/218ms13224 KiB
8Wrong answer0/218ms13096 KiB
9Wrong answer0/317ms13196 KiB
10Wrong answer0/121ms13832 KiB
11Wrong answer0/121ms13780 KiB
12Wrong answer0/221ms14120 KiB
13Wrong answer0/221ms14320 KiB
14Wrong answer0/221ms14168 KiB
15Wrong answer0/220ms14072 KiB
16Wrong answer0/321ms14196 KiB
17Wrong answer0/2510ms75740 KiB
18Wrong answer0/2526ms75696 KiB
19Wrong answer0/4513ms75772 KiB
20Wrong answer0/4513ms76204 KiB
21Wrong answer0/4518ms75776 KiB
22Wrong answer0/4518ms76148 KiB
23Wrong answer0/4546ms74932 KiB