結果

問題 No.505 カードの数式2
ユーザー aimyaimy
提出日時 2017-04-21 23:41:08
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 229 bytes
コンパイル時間 9,331 ms
コンパイル使用メモリ 160,328 KB
実行使用メモリ 11,336 KB
最終ジャッジ日時 2023-09-28 11:24:20
合計ジャッジ時間 12,750 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,236 KB
testcase_01 AC 3 ms
7,252 KB
testcase_02 AC 192 ms
11,176 KB
testcase_03 AC 2 ms
7,036 KB
testcase_04 AC 2 ms
6,976 KB
testcase_05 AC 3 ms
7,076 KB
testcase_06 AC 3 ms
7,236 KB
testcase_07 AC 2 ms
7,048 KB
testcase_08 AC 3 ms
7,096 KB
testcase_09 AC 3 ms
7,100 KB
testcase_10 AC 3 ms
7,112 KB
testcase_11 WA -
testcase_12 AC 3 ms
7,176 KB
testcase_13 AC 3 ms
7,256 KB
testcase_14 AC 3 ms
7,104 KB
testcase_15 AC 2 ms
7,144 KB
testcase_16 AC 2 ms
7,240 KB
testcase_17 WA -
testcase_18 AC 2 ms
7,256 KB
testcase_19 AC 3 ms
7,268 KB
testcase_20 AC 4 ms
8,160 KB
testcase_21 AC 192 ms
11,336 KB
testcase_22 AC 192 ms
11,240 KB
testcase_23 AC 193 ms
11,332 KB
testcase_24 AC 192 ms
11,264 KB
testcase_25 AC 192 ms
11,236 KB
testcase_26 AC 193 ms
11,232 KB
testcase_27 AC 183 ms
11,260 KB
testcase_28 AC 192 ms
11,232 KB
testcase_29 WA -
testcase_30 AC 192 ms
11,316 KB
testcase_31 AC 193 ms
11,256 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 #

main = getLine >> getLine >>= print . cardf . map read . words

cardf :: [Int] -> Int
cardf (n:ns) = cardf' n ns
 where
  cardf' acc [] = acc
  cardf' acc (n:ns) = maximum [cardf' (acc+n) ns, cardf' (acc-n) ns, cardf' (acc*n) ns]
0