結果

問題 No.2790 Athena 3
ユーザー maguroflymagurofly
提出日時 2024-06-21 21:25:16
言語 Ruby
(3.3.0)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 13,184 KB
最終ジャッジ日時 2024-06-21 21:25:20
合計ジャッジ時間 3,064 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
13,056 KB
testcase_01 AC 94 ms
13,056 KB
testcase_02 AC 93 ms
13,056 KB
testcase_03 AC 98 ms
13,056 KB
testcase_04 AC 91 ms
12,928 KB
testcase_05 AC 91 ms
13,184 KB
testcase_06 AC 93 ms
13,056 KB
testcase_07 AC 95 ms
12,928 KB
testcase_08 AC 100 ms
13,056 KB
testcase_09 AC 96 ms
12,928 KB
testcase_10 AC 95 ms
13,056 KB
testcase_11 AC 95 ms
13,184 KB
testcase_12 AC 92 ms
13,184 KB
testcase_13 AC 94 ms
13,056 KB
testcase_14 AC 95 ms
12,928 KB
testcase_15 AC 94 ms
13,056 KB
testcase_16 AC 90 ms
13,184 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require "matrix"
xs = gets.split.map(&:to_f)
def f(x, y)
	[[x - 1, y], [x + 1, y], [x, y + 1], [x, y - 1]]
end
a, b, c = (0 ... 3).map { |i| f(*xs[2 * i, 2]) }
ans = 0.0
a.product(b, c).each do |p, q, r|
	p = Vector[*p, 0]
	q = Vector[*q, 0]
	r = Vector[*r, 0]
	ans = [ans, (p - q).cross(r - q)[2].abs * 0.5].max
end
p ans
0