結果

問題 No.35 タイパー高橋
ユーザー highdhighd
提出日時 2016-08-21 12:06:19
言語 Haskell
(9.8.2)
結果
AC  
実行時間 9 ms / 5,000 ms
コード長 634 bytes
コンパイル時間 6,172 ms
コンパイル使用メモリ 224,612 KB
実行使用メモリ 8,448 KB
最終ジャッジ日時 2024-04-25 11:07:54
合計ジャッジ時間 4,187 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
8,192 KB
testcase_01 AC 7 ms
8,320 KB
testcase_02 AC 7 ms
8,448 KB
testcase_03 AC 9 ms
8,448 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )

Main.hs:14:1: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in 15 further locations.
    Suggested fix: Please use spaces instead.
   |
14 |         let 
   | ^^^^^^^^

Main.hs:24:66: warning: [GHC-47082] [-Woperator-whitespace-ext-conflict]
    The prefix use of a ‘$’ would denote an untyped splice
      were the TemplateHaskell extension enabled.
    Suggested fix: Add whitespace after the ‘$’.
   |
24 |         let (good,miss) =(getSum***getSum) $ foldMap (Sum***Sum) $fmap parse list
   |                                                                  ^
[2 of 2] Linking a.out

ソースコード

diff #

import qualified Data.Text as T
import qualified Data.Text.IO as TI
import Control.Applicative hiding (empty)
import Control.Arrow
import Data.Monoid
import Data.Foldable

readLines = sequence.flip replicate TI.getLine

readInt::String->Int
readInt=read

parse (x:y:[]) = 
	let 
		len=length y
		time=readInt x
		num=12*time `div` 1000
		miss=if num < len then len-num else 0
		num_=if num < len then num else len
	in (num_,miss)
main = do
	m <- readInt<$>getLine
	list <-fmap (fmap (T.unpack).T.split(==' '))<$>readLines m
	let (good,miss) =(getSum***getSum) $ foldMap (Sum***Sum) $fmap parse list
	putStrLn$show good++" "++show miss
0