結果
| 問題 |
No.35 タイパー高橋
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-04-24 17:29:44 |
| 言語 | Haskell (9.10.1) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 5,000 ms |
| コード長 | 554 bytes |
| コンパイル時間 | 1,895 ms |
| コンパイル使用メモリ | 177,404 KB |
| 実行使用メモリ | 12,928 KB |
| 最終ジャッジ日時 | 2024-09-13 11:57:27 |
| 合計ジャッジ時間 | 2,428 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Control.Monad
rInt :: String -> Int
rInt = read
fstInt [t, s] = (rInt t, s)
solve ts = typing [0,0] ts
where
typing xy [] = xy
typing [x,y] (ts:lts)
| tnum > slen = typing [x + slen, y] lts
| otherwise = typing [x + tnum, y + (slen - tnum)] lts
where
tnum = (12 * fst ts) `div` 1000
slen = length $ snd ts
main = do
n <- readLn
ts <- map (fstInt . words) <$> replicateM n getLine
let ans = solve ts
putStrLn $ unwords $ map show ans