結果

問題 No.405 ローマ数字の腕時計
ユーザー torus711torus711
提出日時 2016-08-05 22:25:42
言語 Haskell
(9.8.2)
結果
RE  
実行時間 -
コード長 736 bytes
コンパイル時間 2,968 ms
コンパイル使用メモリ 158,388 KB
実行使用メモリ 7,372 KB
最終ジャッジ日時 2023-08-25 18:14:46
合計ジャッジ時間 2,134 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 2 ms
7,196 KB
testcase_03 AC 2 ms
6,960 KB
testcase_04 AC 2 ms
6,912 KB
testcase_05 AC 2 ms
6,916 KB
testcase_06 AC 2 ms
6,952 KB
testcase_07 AC 2 ms
7,036 KB
testcase_08 AC 2 ms
6,984 KB
testcase_09 AC 2 ms
6,976 KB
testcase_10 AC 2 ms
7,120 KB
testcase_11 RE -
testcase_12 AC 2 ms
7,068 KB
testcase_13 AC 2 ms
7,120 KB
testcase_14 AC 3 ms
7,144 KB
testcase_15 AC 2 ms
7,144 KB
testcase_16 AC 2 ms
7,128 KB
testcase_17 AC 2 ms
7,108 KB
testcase_18 AC 3 ms
7,136 KB
testcase_19 AC 3 ms
7,112 KB
testcase_20 RE -
testcase_21 AC 3 ms
7,076 KB
testcase_22 RE -
testcase_23 AC 2 ms
6,844 KB
testcase_24 AC 3 ms
7,076 KB
testcase_25 AC 3 ms
7,188 KB
testcase_26 AC 3 ms
7,072 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 )

Main.hs:24:1: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in four further locations.
    Suggested fix: Please use spaces instead.
   |
24 |         [ s, t ] <- words <$> getLine
   | ^^^^^^^^
[2 of 2] Linking a.out

ソースコード

diff #

{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf

readInt = ( readLn :: IO Int )
readInts = map ( read :: String -> Int ) . words <$> getLine

getList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

nums = [ "I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII" ]

main = do
	[ s, t ] <- words <$> getLine
	let
		t' = read t
	putStrLn $ ( nums !! ) $ succ $ ( `mod` 12 ) $ ( + 12 ) $ ( `mod` 12 ) $ ( + t' ) $ pred $ fromMaybe 0 $  s `elemIndex` nums 
0