CSES - HIIT Open 2019 - Results
Submission details
Task:Differences
Sender:Omochiikaeri~!
Submission time:2019-05-25 11:46:39 +0300
Language:Python3
Status:READY
Result:ACCEPTED
Test results
testverdicttime
#1ACCEPTED0.24 sdetails

Code

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

def f (t):
    return abs(t[0]-t[1])

print(sum(map(f, zip(sorted(a), sorted(b)))))

Test details

Test 1

Verdict: ACCEPTED

input
100000
880024238 421943433 201872615 ...

correct output
79489641069

user output
79489641069