Created
June 16, 2012 13:34
-
-
Save erukiti/2941348 to your computer and use it in GitHub Desktop.
ARC#004 A問題
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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