結果

問題 No.73 helloworld
ユーザー cympfhcympfh
提出日時 2016-03-16 10:00:17
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 242 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-09 19:57:58
合計ジャッジ時間 2,103 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 77 ms
12,160 KB
testcase_02 AC 76 ms
12,416 KB
testcase_03 AC 78 ms
12,288 KB
testcase_04 AC 77 ms
12,416 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 75 ms
12,160 KB
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

xs=readlines.map(&:to_i).sort.reverse
ac=xs[2..6].inject :*

def c2(n)
  n*(n-1)/2
end

def f(a,b)
  r = (b/2) * (b - b/2)
  m = 0
  for k in 1..a
    m = [c2(a-k) * k, m].max
  end
  r * m
end

p [f(xs[0],xs[1]) , f(xs[1],xs[0]) ].max * ac

0