結果

問題 No.836 じょうよ
ユーザー torus711torus711
提出日時 2019-06-22 14:40:36
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 873 bytes
コンパイル時間 3,637 ms
コンパイル使用メモリ 162,244 KB
実行使用メモリ 11,356 KB
最終ジャッジ日時 2023-08-27 02:49:07
合計ジャッジ時間 3,889 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 3 ms
6,948 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 3 ms
7,072 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 22 ms
11,172 KB
testcase_37 AC 22 ms
11,188 KB
testcase_38 AC 32 ms
11,188 KB
testcase_39 AC 22 ms
11,140 KB
testcase_40 AC 42 ms
11,192 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 )

Main.hs:33:1: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in one further location.
    Suggested fix: Please use spaces instead.
   |
33 |         [ l, r, n ] <- readInts
   | ^^^^^^^^
[2 of 2] Linking a.out

ソースコード

diff #

{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readNInts = readInt >>= flip replicateM readInt

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	[ l, r, n ] <- readInts
	mapM_ print $ map ( solve2 l r n ) [ 0 .. n - 1 ]

solve2 l r n i = solve1 r n i - solve1 l n ( i - 1 )

solve1 ub n i = ub `div` n + ( if ub `mod` n <= i then 1 else 0 )
0