結果
| 問題 |
No.250 atetubouのzetubou
|
| コンテスト | |
| ユーザー |
alpha_virginis
|
| 提出日時 | 2017-02-22 16:08:32 |
| 言語 | Haskell (9.10.1) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,247 bytes |
| コンパイル時間 | 1,558 ms |
| コンパイル使用メモリ | 150,528 KB |
| 最終ジャッジ日時 | 2024-12-30 18:45:25 |
| 合計ジャッジ時間 | 2,403 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main ( Main.hs, Main.o )
Main.hs:12:1: error: [GHC-87110]
Could not load module ‘Data.IntMap’.
It is a member of the hidden package ‘containers-0.6.8’.
Use -v to see a list of the files searched for.
|
12 | import qualified Data.IntMap as IntMap
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Main.hs:13:1: error: [GHC-87110]
Could not load module ‘Data.Map’.
It is a member of the hidden package ‘containers-0.6.8’.
Use -v to see a list of the files searched for.
|
13 | import qualified Data.Map as Map
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ソースコード
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Maybe
import qualified Data.ByteString.Char8 as C
import Control.Monad(forM_)
import Data.Int
import Data.List
import Data.Array
import Data.Word
import Data.Bits
import qualified Data.IntMap as IntMap
import qualified Data.Map as Map
yes :: C.ByteString
yes = "AC"
no :: C.ByteString
no = "ZETUBOU"
getInts :: IO [Int]
getInts = do
ss <- C.getLine
return $ map (fst . fromJust . C.readInt) $ C.words ss
getIntss :: Int -> IO [[Int]]
getIntss 0 = return []
getIntss n = do
xs <- getInts
xss <- getIntss (n - 1)
return $ xs : xss
-- end standard template --
limitedCombination :: Int -> Int -> Int -> Int
limitedCombination t n r
| n `div` 2 < r = limitedCombination t n (n - r)
| otherwise = z
where
z = f 1 [n,n-1..1] [1..r]
f :: Int -> [Int] -> [Int] -> Int
f w _ [] = w
f w (x:xs) (y:ys)
| w > t = t + 1
| otherwise = f (w * x `div` y) xs ys
main :: IO ()
main = do
[q] <- getInts
xss <- getIntss q
let res = solve xss
forM_ res $ \x -> C.putStrLn x
solve :: [[Int]] -> [C.ByteString]
solve [] = []
solve ([d,x,t]:xs) = y : solve xs
where
y = if limitedCombination t (d + x - 1) (d - 1) <= t then yes else no
alpha_virginis