87172024-01-26 14:44:18kristofMekk Mester munkái (50 pont)pypy3Wrong answer 7/50686ms92540 KiB
def keres(a):
    return rendelesekKereso.index(a)+1

resz = list(map(int, input().split()))
megrendelesekSzama = resz[0]
napokSzama = resz[1]
rendelesek = []
for i in range(megrendelesekSzama):
    asd = tuple(map(int, input().split()))
    rendelesek.append(asd)
global rendelesekKereso
rendelesekKereso = rendelesek.copy()
rendelesek.sort()
rendelesek.sort(key=lambda x: x[1])
mekkUtolso = -1
fiaUtolso = 0
mekkL = []
fiaL = []
for i, value in enumerate(rendelesek):
    if fiaUtolso < value[0]:
        fiaUtolso = value[1]
        fiaL.append(keres(rendelesek[i]))
    elif mekkUtolso < value[0]:
        mekkUtolso = value[1]
        mekkL.append(keres(rendelesek[i]))


print(len(mekkL), len(fiaL))
print(*mekkL)
print(*fiaL)
SubtaskSumTestVerdictTimeMemory
base7/50
1Accepted0/043ms76540 KiB
2Wrong answer0/0209ms92540 KiB
3Accepted1/143ms78188 KiB
4Accepted1/143ms78208 KiB
5Wrong answer0/254ms78572 KiB
6Wrong answer0/248ms79040 KiB
7Accepted2/257ms86752 KiB
8Wrong answer0/252ms86676 KiB
9Accepted3/348ms86680 KiB
10Wrong answer0/174ms88936 KiB
11Wrong answer0/174ms89500 KiB
12Wrong answer0/275ms89316 KiB
13Wrong answer0/282ms89852 KiB
14Wrong answer0/290ms89736 KiB
15Wrong answer0/298ms89988 KiB
16Wrong answer0/3103ms90152 KiB
17Time limit exceeded0/2672ms45544 KiB
18Time limit exceeded0/2686ms45744 KiB
19Time limit exceeded0/4662ms45744 KiB
20Time limit exceeded0/4683ms45696 KiB
21Time limit exceeded0/4633ms45828 KiB
22Time limit exceeded0/4685ms45972 KiB
23Time limit exceeded0/4676ms46212 KiB