結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー tjnttjnt
提出日時 2021-08-04 20:10:28
言語 Haskell
(9.8.2)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 447 bytes
コンパイル時間 17,507 ms
コンパイル使用メモリ 162,704 KB
実行使用メモリ 23,396 KB
最終ジャッジ日時 2023-10-14 21:24:28
合計ジャッジ時間 15,951 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
11,420 KB
testcase_01 AC 133 ms
22,284 KB
testcase_02 AC 2 ms
6,948 KB
testcase_03 AC 2 ms
6,892 KB
testcase_04 AC 3 ms
6,908 KB
testcase_05 AC 133 ms
22,360 KB
testcase_06 AC 3 ms
6,888 KB
testcase_07 AC 3 ms
7,068 KB
testcase_08 AC 3 ms
6,932 KB
testcase_09 AC 3 ms
7,016 KB
testcase_10 AC 2 ms
6,896 KB
testcase_11 AC 3 ms
6,960 KB
testcase_12 AC 3 ms
6,904 KB
testcase_13 AC 3 ms
6,964 KB
testcase_14 AC 83 ms
16,872 KB
testcase_15 AC 43 ms
13,876 KB
testcase_16 AC 103 ms
19,144 KB
testcase_17 AC 42 ms
14,004 KB
testcase_18 AC 103 ms
19,156 KB
testcase_19 AC 82 ms
16,468 KB
testcase_20 AC 133 ms
22,556 KB
testcase_21 AC 12 ms
11,124 KB
testcase_22 AC 52 ms
14,892 KB
testcase_23 AC 132 ms
21,476 KB
testcase_24 AC 133 ms
23,396 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 qualified Data.Vector.Mutable as MV
import Control.Monad.ST

solve :: Int -> [Int] -> Int
solve s l = runST $ MV.replicate s 0 >>= \v -> go v l
  where
    go v []  = fst <$> MV.ifoldr (\i x (ai,ax) ->
        if ax < x then (i,x) else (ai,ax)) (0,0) v
    go v (x:xs) = do
        MV.modify v succ x
        go v xs

main :: IO ()
main = do
    _ <- readLn :: IO Int
    l <- map read . words <$> getLine :: IO [Int]
    print $ solve 7 l
0