Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created May 2, 2019 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/b1a872152a94ba57de8915a1f6f01bf4 to your computer and use it in GitHub Desktop.
Save whatalnk/b1a872152a94ba57de8915a1f6f01bf4 to your computer and use it in GitHub Desktop.
AtCoder ABC #125 B - Resale
n = gets.chomp.to_i
v = gets.chomp.split(" ").map(&:to_i)
c = gets.chomp.split(" ").map(&:to_i)
ans = 0
n.times do |i|
xy = v[i] - c[i]
ans += xy if xy > 0
end
puts ans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment