結果
問題 |
No.35 タイパー高橋
|
ユーザー |
|
提出日時 | 2025-08-20 13:26:59 |
言語 | Standard ML (MLton 20210117) |
結果 |
AC
|
実行時間 | 7 ms / 5,000 ms |
コード長 | 1,088 bytes |
コンパイル時間 | 4,643 ms |
コンパイル使用メモリ | 689,528 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-08-20 13:27:04 |
合計ジャッジ時間 | 3,935 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 |
ソースコード
fun readInt () = valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn) fun readStr () = valOf (TextIO.inputLine TextIO.stdIn) fun readStrWithoutWS () = let val s = readStr () in String.implode (List.filter (fn c => Char.isAlphaNum c) (String.explode s)) end val () = let val n = readInt () val segments = List.tabulate (n, fn _ => (readInt (), readStrWithoutWS ())) val ans = List.foldl (fn ((timeLimit, s), (canTypeAcc, missAcc)) => let val numOfType = 12 * timeLimit div 1000 val canType = Int.min (String.size s, numOfType) val miss = String.size s - canType in (canType + canTypeAcc, miss + missAcc) end ) (0, 0) segments in print (Int.toString (#1 ans) ^ " " ^ Int.toString (#2 ans) ^ "\n") end