結果

問題 No.191 供託金
ユーザー tanson
提出日時 2025-09-09 00:50:24
言語 Standard ML
(MLton 20210117)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 654 bytes
コンパイル時間 4,049 ms
コンパイル使用メモリ 686,904 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-09 00:50:30
合計ジャッジ時間 5,954 ms
ジャッジサーバーID
(参考情報)
judge / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

fun readInt () =
    valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn)


fun findAns cs =
    let
        val totalNumberOfVotes = List.foldl (fn (c, acc) => c + acc) 0 cs
        val ans = List.foldl (fn (c, acc) =>
                                 if totalNumberOfVotes div 10 < c then acc
                                 else 30 + acc)
                             0
                             cs
    in
        ans
    end


val () =
    let
        val n = readInt ()
        val cs = List.tabulate (n, fn _ => readInt ())
                        
        val ans = findAns cs
    in
        print (Int.toString ans ^ "\n")
    end
0