結果

問題 No.45 回転寿司
ユーザー 34056915823405691582
提出日時 2017-03-21 03:37:01
言語 Haskell
(9.8.2)
結果
AC  
実行時間 7 ms / 5,000 ms
コード長 315 bytes
コンパイル時間 2,810 ms
コンパイル使用メモリ 164,160 KB
実行使用メモリ 11,328 KB
最終ジャッジ日時 2023-08-27 15:24:01
合計ジャッジ時間 4,286 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
9,020 KB
testcase_01 AC 5 ms
9,724 KB
testcase_02 AC 6 ms
10,768 KB
testcase_03 AC 6 ms
11,156 KB
testcase_04 AC 5 ms
9,856 KB
testcase_05 AC 3 ms
7,560 KB
testcase_06 AC 5 ms
9,420 KB
testcase_07 AC 6 ms
10,676 KB
testcase_08 AC 3 ms
8,328 KB
testcase_09 AC 6 ms
10,868 KB
testcase_10 AC 4 ms
9,156 KB
testcase_11 AC 3 ms
8,160 KB
testcase_12 AC 6 ms
10,964 KB
testcase_13 AC 3 ms
7,588 KB
testcase_14 AC 3 ms
7,400 KB
testcase_15 AC 4 ms
9,272 KB
testcase_16 AC 4 ms
8,416 KB
testcase_17 AC 4 ms
8,876 KB
testcase_18 AC 3 ms
8,464 KB
testcase_19 AC 4 ms
10,352 KB
testcase_20 AC 2 ms
7,336 KB
testcase_21 AC 2 ms
7,516 KB
testcase_22 AC 2 ms
6,888 KB
testcase_23 AC 2 ms
7,036 KB
testcase_24 AC 2 ms
7,096 KB
testcase_25 AC 3 ms
7,196 KB
testcase_26 AC 5 ms
9,160 KB
testcase_27 AC 5 ms
10,324 KB
testcase_28 AC 4 ms
9,392 KB
testcase_29 AC 5 ms
10,044 KB
testcase_30 AC 5 ms
10,148 KB
testcase_31 AC 3 ms
7,252 KB
testcase_32 AC 3 ms
7,060 KB
testcase_33 AC 7 ms
11,328 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.Array
main = do
  n <- getLine
  vs <- map read . words <$> getLine :: IO [Int]
  putStrLn $ show $ head $ maxTaste vs

maxTaste :: [Int] -> [Int]
maxTaste [v] = [v]
maxTaste (v:[v']) = max v v':[v']
maxTaste (v:v':v'':vs) =
  let
    ts'@(t':t'':ts) = maxTaste (v':v'':vs)
  in
    max (v + t'') t':ts'
0