109812024-04-25 15:38:39WellLeopardUsuallyDarabolás (50 pont)python3Wrong answer 0/50268ms44168 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)+100):
    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/018ms11268 KiB
2Wrong answer0/0159ms33996 KiB
3Wrong answer0/117ms11780 KiB
4Runtime error0/118ms12200 KiB
5Runtime error0/118ms12140 KiB
6Runtime error0/117ms12472 KiB
7Runtime error0/117ms12648 KiB
8Runtime error0/117ms13120 KiB
9Runtime error0/117ms13288 KiB
10Runtime error0/117ms13152 KiB
11Runtime error0/118ms13388 KiB
12Runtime error0/118ms13428 KiB
13Runtime error0/117ms13488 KiB
14Wrong answer0/118ms13800 KiB
15Runtime error0/119ms13736 KiB
16Runtime error0/118ms13536 KiB
17Runtime error0/118ms13696 KiB
18Runtime error0/118ms13992 KiB
19Runtime error0/218ms13856 KiB
20Runtime error0/218ms13696 KiB
21Runtime error0/328ms15392 KiB
22Runtime error0/339ms16824 KiB
23Runtime error0/478ms26192 KiB
24Runtime error0/486ms25472 KiB
25Runtime error0/4143ms38308 KiB
26Runtime error0/4152ms36600 KiB
27Time limit exceeded0/4254ms44168 KiB
28Time limit exceeded0/4268ms21756 KiB