結果

問題 No.605 板挟みの球面
ユーザー kuwakuwa
提出日時 2017-12-10 03:25:01
言語 Haskell
(9.6.2)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 761 bytes
コンパイル時間 7,608 ms
コンパイル使用メモリ 164,136 KB
実行使用メモリ 8,236 KB
最終ジャッジ日時 2023-08-20 06:22:30
合計ジャッジ時間 7,782 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
8,236 KB
testcase_01 AC 3 ms
8,192 KB
testcase_02 AC 2 ms
8,104 KB
testcase_03 AC 3 ms
8,088 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 )
[2 of 2] Linking a.out

ソースコード

diff #

module Main where
import Control.Monad
import Control.Applicative
import Data.Maybe
import Data.List
import qualified Text.Printf
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString as BC

------------------------------------------

main :: IO ()
main = do
  a <- readLn
  b <- readLn
  putStrLn $ doubleFmt (2*pi*(b-a))

------------------------------------------

{- Int input -}

parseInt :: BC.ByteString -> Int
parseInt = fst . fromJust . BC.readInt

parseInts :: BC.ByteString -> [Int]
parseInts = map parseInt <$> BC.words

readInt :: IO Int
readInt = parseInt <$> BC.getLine

readInts :: IO [Int]
readInts = parseInts <$> BC.getLine

{- Double Formatting -}

doubleFmt :: Double -> String
doubleFmt = Text.Printf.printf "%.8f"
0