結果

問題 No.90 品物の並び替え
ユーザー trineutrontrineutron
提出日時 2019-05-10 15:19:45
言語 Haskell
(9.8.2)
結果
AC  
実行時間 1,763 ms / 5,000 ms
コード長 280 bytes
コンパイル時間 6,194 ms
コンパイル使用メモリ 160,840 KB
実行使用メモリ 14,076 KB
最終ジャッジ日時 2023-09-14 17:55:50
合計ジャッジ時間 8,864 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,252 KB
testcase_01 AC 122 ms
11,220 KB
testcase_02 AC 3 ms
7,316 KB
testcase_03 AC 12 ms
10,200 KB
testcase_04 AC 22 ms
10,260 KB
testcase_05 AC 142 ms
11,248 KB
testcase_06 AC 92 ms
11,292 KB
testcase_07 AC 4 ms
7,756 KB
testcase_08 AC 3 ms
7,140 KB
testcase_09 AC 1,763 ms
14,076 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
    [n, m] <- map read . words <$> getLine
    xs <- map (map read . words) . lines <$> getContents
    print . maximum . map (getScore xs) $ permutations [0..n-1]

getScore xs ys = sum . map last $ filter (\i -> (ys !! (i !! 0)) > (ys !! (i !! 1))) xs
0