結果
問題 | No.8 N言っちゃダメゲーム |
ユーザー | こまる |
提出日時 | 2020-10-19 01:45:05 |
言語 | Haskell (9.8.2) |
結果 |
AC
|
実行時間 | 4 ms / 5,000 ms |
コード長 | 627 bytes |
コンパイル時間 | 1,196 ms |
コンパイル使用メモリ | 162,120 KB |
実行使用メモリ | 8,336 KB |
最終ジャッジ日時 | 2023-09-28 12:10:31 |
合計ジャッジ時間 | 1,884 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
7,092 KB |
testcase_01 | AC | 2 ms
6,912 KB |
testcase_02 | AC | 3 ms
6,908 KB |
testcase_03 | AC | 4 ms
8,256 KB |
testcase_04 | AC | 4 ms
8,112 KB |
testcase_05 | AC | 4 ms
8,336 KB |
testcase_06 | AC | 4 ms
8,264 KB |
testcase_07 | AC | 4 ms
8,136 KB |
testcase_08 | AC | 4 ms
8,216 KB |
testcase_09 | AC | 4 ms
8,132 KB |
testcase_10 | AC | 4 ms
8,120 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
ソースコード
{-# LANGUAGE BangPatterns #-} import qualified Data.Vector.Fusion.Stream.Monadic as VFSM stream :: Monad m => Int -> Int -> VFSM.Stream m Int stream !l !r = VFSM.Stream step l where step x | x < r = return $ VFSM.Yield x (x + 1) | otherwise = return $ VFSM.Done {-# INLINE [0] step #-} {-# INLINE [1] stream #-} rep :: Monad m => Int -> (Int -> m ()) -> m () rep n = flip VFSM.mapM_ (stream 0 n) {-# INLINE rep #-} main :: IO () main = do p <- readLn :: IO Int rep p $ \_ -> do [a, b] <- map read . words <$> getLine if (mod (a - 1) (b + 1) == 0) then putStrLn "Lose" else putStrLn "Win"