結果

問題 No.374 コイン
ユーザー はむ吉🐹
提出日時 2016-06-04 22:31:26
言語 Haskell
(9.10.1)
結果
WA  
実行時間 -
コード長 314 bytes
コンパイル時間 6,430 ms
コンパイル使用メモリ 173,996 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-08 08:35:01
合計ジャッジ時間 5,112 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

ソースコード

diff #

import Control.Applicative ((<$>))
import Data.Int (Int64)

canSWin :: Integral a => a -> a -> Bool
canSWin a b
    | a < b = False
    | otherwise = odd $ 2 * (a - b) `div` b

main :: IO ()
main = do
    [a, b] <- fmap (read :: String -> Int64) . words <$> getLine
    putStrLn $ if canSWin a b then "S" else "K"
0