結果

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

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