Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created October 10, 2017 16:16
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/c06787da4208bf8aedcd1ef2fe211827 to your computer and use it in GitHub Desktop.
Save whatalnk/c06787da4208bf8aedcd1ef2fe211827 to your computer and use it in GitHub Desktop.
AtCoder ARC #033 B - メタ構文変数
require 'set'
na, nb = gets.chomp.split(" ").map(&:to_i)
a = Set.new(gets.chomp.split(" ").map(&:to_i))
b = Set.new(gets.chomp.split(" ").map(&:to_i))
puts (a & b).size.to_f / (a | b).size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment