結果

問題 No.268 ラッピング(Easy)
ユーザー aimyaimy
提出日時 2017-05-02 20:26:50
言語 Haskell
(9.6.2)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 317 bytes
コンパイル時間 1,284 ms
コンパイル使用メモリ 164,500 KB
実行使用メモリ 7,456 KB
最終ジャッジ日時 2023-10-12 05:15:48
合計ジャッジ時間 2,548 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,260 KB
testcase_01 AC 2 ms
7,456 KB
testcase_02 AC 3 ms
7,288 KB
testcase_03 AC 3 ms
7,268 KB
testcase_04 AC 3 ms
7,188 KB
testcase_05 AC 2 ms
7,260 KB
testcase_06 AC 2 ms
7,312 KB
testcase_07 AC 3 ms
7,332 KB
testcase_08 AC 3 ms
7,216 KB
testcase_09 AC 2 ms
7,264 KB
testcase_10 AC 2 ms
7,224 KB
testcase_11 AC 3 ms
7,256 KB
testcase_12 AC 2 ms
7,176 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.List

main = do
 [l1,l2,l3] <- map read . words <$> getLine
 [r,b,y] <- map read . words <$> getLine
 print $ wrapping (l1,l2,l3) (r,b,y)

wrapping (l1,l2,l3) (r,b,y) = sum $ zipWith (*) (sort [l12,l23,l31]) (reverse (sort [r,b,y]))
 where
  l12 = 2 * (l1 + l2)
  l23 = 2 * (l2 + l3)
  l31 = 2 * (l3 + l1)
0