結果

問題 No.836 じょうよ
ユーザー torus711torus711
提出日時 2019-06-22 14:43:54
言語 Haskell
(9.6.2)
結果
AC  
実行時間 62 ms / 1,000 ms
コード長 877 bytes
コンパイル時間 1,044 ms
コンパイル使用メモリ 162,108 KB
実行使用メモリ 11,472 KB
最終ジャッジ日時 2023-08-27 02:49:42
合計ジャッジ時間 3,536 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
11,412 KB
testcase_01 AC 3 ms
7,144 KB
testcase_02 AC 3 ms
7,204 KB
testcase_03 AC 2 ms
7,080 KB
testcase_04 AC 3 ms
7,156 KB
testcase_05 AC 3 ms
7,308 KB
testcase_06 AC 3 ms
7,164 KB
testcase_07 AC 3 ms
7,092 KB
testcase_08 AC 3 ms
7,084 KB
testcase_09 AC 3 ms
7,156 KB
testcase_10 AC 3 ms
7,180 KB
testcase_11 AC 12 ms
11,264 KB
testcase_12 AC 12 ms
11,316 KB
testcase_13 AC 12 ms
11,172 KB
testcase_14 AC 5 ms
8,560 KB
testcase_15 AC 12 ms
11,268 KB
testcase_16 AC 62 ms
11,380 KB
testcase_17 AC 62 ms
11,368 KB
testcase_18 AC 12 ms
11,436 KB
testcase_19 AC 22 ms
11,356 KB
testcase_20 AC 42 ms
11,400 KB
testcase_21 AC 6 ms
9,756 KB
testcase_22 AC 22 ms
11,344 KB
testcase_23 AC 42 ms
11,292 KB
testcase_24 AC 12 ms
11,216 KB
testcase_25 AC 22 ms
11,280 KB
testcase_26 AC 4 ms
8,444 KB
testcase_27 AC 5 ms
9,444 KB
testcase_28 AC 12 ms
11,372 KB
testcase_29 AC 6 ms
10,288 KB
testcase_30 AC 5 ms
9,196 KB
testcase_31 AC 12 ms
11,188 KB
testcase_32 AC 12 ms
11,196 KB
testcase_33 AC 5 ms
9,048 KB
testcase_34 AC 13 ms
11,168 KB
testcase_35 AC 12 ms
11,300 KB
testcase_36 AC 32 ms
11,436 KB
testcase_37 AC 32 ms
11,340 KB
testcase_38 AC 32 ms
11,460 KB
testcase_39 AC 32 ms
11,296 KB
testcase_40 AC 52 ms
11,472 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.readInteger ) . 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 - 1 ) n i

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