109802024-04-25 15:37:46WellLeopardUsuallyDarabolás (50 pont)python3Wrong answer 0/50257ms44468 KiB
n, m = map(int, input().split())
sor = (list(map(int, input().split())))
oszlop = (list(map(int, input().split())))
sor.sort()
oszlop.sort()
vv = 1
fv = 1
koltseg = 0
print(sor)

for i in range (len(sor) + len(oszlop)+1):
    if sor [-1] > oszlop [-1]:
        vv += 1
        if sor[-1] == 1:
            koltseg += fv
        else:
            koltseg += sor.pop() * fv
    else:
        fv += 1
        if oszlop [-1] == 1:
            koltseg += vv
        else:
            koltseg += oszlop.pop() * vv

print(koltseg)
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/017ms11228 KiB
2Wrong answer0/0160ms34064 KiB
3Wrong answer0/117ms11636 KiB
4Runtime error0/117ms11908 KiB
5Runtime error0/118ms12056 KiB
6Runtime error0/117ms12424 KiB
7Runtime error0/117ms12436 KiB
8Runtime error0/117ms12124 KiB
9Runtime error0/118ms12432 KiB
10Runtime error0/118ms13080 KiB
11Runtime error0/118ms13168 KiB
12Runtime error0/118ms12996 KiB
13Runtime error0/117ms12640 KiB
14Wrong answer0/118ms13516 KiB
15Runtime error0/118ms13284 KiB
16Runtime error0/119ms13420 KiB
17Runtime error0/119ms13528 KiB
18Runtime error0/119ms13620 KiB
19Runtime error0/219ms13872 KiB
20Runtime error0/219ms13772 KiB
21Runtime error0/328ms15324 KiB
22Runtime error0/339ms17368 KiB
23Runtime error0/479ms26332 KiB
24Runtime error0/487ms25752 KiB
25Runtime error0/4143ms38556 KiB
26Runtime error0/4150ms36752 KiB
27Time limit exceeded0/4250ms44308 KiB
28Time limit exceeded0/4257ms44468 KiB