Skip to content

Instantly share code, notes, and snippets.

@erukiti
Created June 16, 2012 13:34
Show Gist options
  • Save erukiti/2941348 to your computer and use it in GitHub Desktop.
Save erukiti/2941348 to your computer and use it in GitHub Desktop.
ARC#004 A問題
#! /usr/bin/env ruby
# coding: utf-8
n = STDIN.gets.to_i
x = []
y = []
(0 ... n).each do |i|
x[i], y[i] = STDIN.gets.strip.split(' ')
x[i] = x[i].to_i
y[i] = y[i].to_i
end
max = 0
(0 ... n).each do |i|
(0 ... n).each do |j|
next if i == j
len = Math.sqrt((x[i] - x[j]).abs ** 2 + (y[i] - y[j]).abs ** 2)
max = len if max < len
end
end
print "#{max}\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment