85022024-01-19 14:55:04kristofMekk Mester munkái (50 pont)python3Wrong answer 1/50702ms22684 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 = 0
fiaUtolso = 0
mekkL = []
fiaL = []
for i, value in enumerate(rendelesek):
    if fiaUtolso<mekkUtolso:

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


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

SubtaskSumTestVerdictTimeMemory
base1/50
1Accepted0/018ms11772 KiB
2Wrong answer0/074ms15564 KiB
3Accepted1/118ms12236 KiB
4Wrong answer0/118ms12640 KiB
5Wrong answer0/217ms13096 KiB
6Wrong answer0/217ms13040 KiB
7Wrong answer0/217ms13120 KiB
8Wrong answer0/218ms13328 KiB
9Wrong answer0/317ms13688 KiB
10Wrong answer0/121ms13992 KiB
11Wrong answer0/121ms14084 KiB
12Wrong answer0/223ms14164 KiB
13Wrong answer0/224ms14416 KiB
14Wrong answer0/226ms14292 KiB
15Wrong answer0/228ms14476 KiB
16Wrong answer0/329ms14284 KiB
17Time limit exceeded0/2702ms22120 KiB
18Time limit exceeded0/2685ms22124 KiB
19Time limit exceeded0/4665ms22204 KiB
20Time limit exceeded0/4669ms22408 KiB
21Time limit exceeded0/4680ms22684 KiB
22Time limit exceeded0/4669ms22432 KiB
23Time limit exceeded0/4672ms21832 KiB