87182024-01-26 14:59:37kristofMekk Mester munkái (50 pont)pypy3Time limit exceeded 26/50693ms92784 KiB
resz = list(map(int, input().split()))
megrendelesekSzama = resz[0]
napokSzama = resz[1]
rendelesek = []
for i in range(megrendelesekSzama):
    asd = list(map(int, input().split()))
    asd.append(i+1)
    rendelesek.append(asd)
rendelesek.sort()
rendelesek.sort(key=lambda x: x[1])
mekkUtolso = -1
fiaUtolso = 0
mekkL = []
fiaL = []
for i, value in enumerate(rendelesek):
    if fiaUtolso>mekkUtolso:

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


print(len(mekkL), len(fiaL))
print(*mekkL)
print(*fiaL)

SubtaskSumTestVerdictTimeMemory
base26/50
1Accepted0/048ms76404 KiB
2Accepted0/0149ms92784 KiB
3Accepted1/146ms78028 KiB
4Accepted1/150ms78816 KiB
5Accepted2/250ms78832 KiB
6Accepted2/246ms78680 KiB
7Accepted2/243ms78916 KiB
8Accepted2/246ms81288 KiB
9Accepted3/343ms79528 KiB
10Accepted1/172ms88452 KiB
11Accepted1/172ms88288 KiB
12Accepted2/282ms88828 KiB
13Accepted2/281ms89344 KiB
14Accepted2/276ms89576 KiB
15Accepted2/297ms89764 KiB
16Accepted3/386ms89932 KiB
17Time limit exceeded0/2670ms48364 KiB
18Time limit exceeded0/2693ms49116 KiB
19Time limit exceeded0/4685ms48512 KiB
20Time limit exceeded0/4685ms48552 KiB
21Time limit exceeded0/4672ms48596 KiB
22Time limit exceeded0/4684ms49244 KiB
23Time limit exceeded0/4685ms48764 KiB