[2016][ruby][20.x]

profile
Alpha Chen 8 years ago
parent 3c99f5cf03
commit 54a44cd143

File diff suppressed because it is too large Load Diff

@ -0,0 +1,14 @@
blacklist = ARGF.read.split("\n").map {|line| Range.new(*line.split(?-).map(&:to_i)) }
ip = 0
count = 0
until ip > 4294967295
range = blacklist.find {|range| range.cover?(ip) }
if range.nil?
count += 1
ip += 1
else
ip = range.end + 1
end
end
puts count
Loading…
Cancel
Save