Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created March 10, 2019 02:59
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/3bded287c0ea8f0e6c55dbe6cbffa752 to your computer and use it in GitHub Desktop.
Save whatalnk/3bded287c0ea8f0e6c55dbe6cbffa752 to your computer and use it in GitHub Desktop.
AtCoder ABC #121 B - Can you solve this?
N, M, C = gets.chomp.split(" ").map(&:to_i)
B = gets.chomp.split(" ").map(&:to_i)
ans = 0
N.times do
a = gets.chomp.split(" ").map(&:to_i)
x = C
M.times do |i|
x += a[i] * B[i]
end
if x > 0
ans += 1
end
end
puts ans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment