CSES - HIIT Open 2019 - Results
Submission details
Task:Differences
Sender:Haapsaari
Submission time:2019-05-25 11:53:16 +0300
Language:Python3
Status:READY
Result:ACCEPTED
Test results
testverdicttime
#1ACCEPTED0.27 sdetails

Code

n = int(input())
a,b = list(map(lambda x: int(x), input().split(' '))), list(map(lambda x: int(x), input().split(' ')))

a.sort()
b.sort()

c = [abs(a[i] - b[i]) for i in range(len(a))]


print(sum(c))

Test details

Test 1

Verdict: ACCEPTED

input
100000
880024238 421943433 201872615 ...

correct output
79489641069

user output
79489641069