結果

問題 No.73 helloworld
ユーザー maimai
提出日時 2018-09-02 10:29:29
言語 Ruby
(3.3.0)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 263 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 11,348 KB
実行使用メモリ 15,312 KB
最終ジャッジ日時 2023-09-13 19:39:45
合計ジャッジ時間 2,782 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,312 KB
testcase_01 AC 79 ms
15,148 KB
testcase_02 AC 79 ms
15,168 KB
testcase_03 AC 79 ms
15,192 KB
testcase_04 AC 78 ms
15,184 KB
testcase_05 AC 78 ms
15,240 KB
testcase_06 AC 79 ms
15,092 KB
testcase_07 AC 80 ms
15,256 KB
testcase_08 AC 78 ms
15,048 KB
testcase_09 AC 78 ms
15,292 KB
testcase_10 AC 78 ms
15,052 KB
testcase_11 AC 78 ms
15,288 KB
testcase_12 AC 79 ms
15,308 KB
testcase_13 AC 79 ms
15,156 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

C = (?a..?z).reduce({}){|s,e| s[e]=gets.to_i; s}

# helloworld
# hellloowrd

hewrd = C[?h]*C[?e]*C[?w]*C[?r]*C[?d]

o = C[?o]
o = o/2*((o+1)/2)

l = C[?l]
bestl = 0
(1..(l-1)).each do |l1|
    l2 = l-l1
    bestl = [bestl, l1*l2*(l2-1)/2].max
end

p hewrd*o*bestl
0