結果
問題 | No.1110 好きな歌 |
ユーザー | aoshima |
提出日時 | 2020-07-17 11:58:18 |
言語 | Haskell (9.8.2) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,030 bytes |
コンパイル時間 | 13,477 ms |
コンパイル使用メモリ | 207,488 KB |
実行使用メモリ | 59,392 KB |
最終ジャッジ日時 | 2024-11-28 00:20:32 |
合計ジャッジ時間 | 189,170 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
36,096 KB |
testcase_01 | AC | 2 ms
10,496 KB |
testcase_02 | AC | 1 ms
10,496 KB |
testcase_03 | AC | 2 ms
28,032 KB |
testcase_04 | AC | 2 ms
27,904 KB |
testcase_05 | AC | 1 ms
28,160 KB |
testcase_06 | AC | 1 ms
28,160 KB |
testcase_07 | AC | 1 ms
10,496 KB |
testcase_08 | AC | 2 ms
21,632 KB |
testcase_09 | AC | 2 ms
10,624 KB |
testcase_10 | AC | 2 ms
21,504 KB |
testcase_11 | AC | 2 ms
10,624 KB |
testcase_12 | AC | 2 ms
33,152 KB |
testcase_13 | AC | 2 ms
10,624 KB |
testcase_14 | AC | 10 ms
39,936 KB |
testcase_15 | AC | 7 ms
20,736 KB |
testcase_16 | AC | 9 ms
13,184 KB |
testcase_17 | AC | 18 ms
25,472 KB |
testcase_18 | AC | 2 ms
50,048 KB |
testcase_19 | AC | 21 ms
39,936 KB |
testcase_20 | AC | 16 ms
13,184 KB |
testcase_21 | AC | 8 ms
52,736 KB |
testcase_22 | AC | 14 ms
49,920 KB |
testcase_23 | AC | 6 ms
51,456 KB |
testcase_24 | TLE | - |
testcase_25 | TLE | - |
testcase_26 | TLE | - |
testcase_27 | TLE | - |
testcase_28 | TLE | - |
testcase_29 | TLE | - |
testcase_30 | TLE | - |
testcase_31 | TLE | - |
testcase_32 | TLE | - |
testcase_33 | TLE | - |
testcase_34 | TLE | - |
testcase_35 | TLE | - |
testcase_36 | TLE | - |
testcase_37 | TLE | - |
testcase_38 | TLE | - |
testcase_39 | TLE | - |
testcase_40 | TLE | - |
testcase_41 | AC | 4,687 ms
12,032 KB |
testcase_42 | TLE | - |
testcase_43 | TLE | - |
testcase_44 | TLE | - |
testcase_45 | TLE | - |
testcase_46 | TLE | - |
testcase_47 | TLE | - |
testcase_48 | TLE | - |
testcase_49 | TLE | - |
testcase_50 | TLE | - |
testcase_51 | TLE | - |
testcase_52 | TLE | - |
testcase_53 | TLE | - |
コンパイルメッセージ
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
ソースコード
import qualified Control.Arrow as Arrow import Control.Monad (replicateM) import qualified Data.List as L import qualified Data.ByteString.Char8 as BSC8 import qualified Data.Maybe as Maybe import qualified Data.Vector.Unboxed as VU getInt :: BSC8.ByteString -> Maybe (Int, BSC8.ByteString) getInt = fmap (Arrow.second BSC8.tail) . BSC8.readInt getAB :: IO (Int, Int) getAB = (\vec -> (vec VU.! 0, vec VU.! 1)) . VU.unfoldrN 2 getInt <$> BSC8.getLine main :: IO () main = do (n, d) <- getAB xs <- map (fst. Maybe.fromJust . BSC8.readInt) <$> replicateM n BSC8.getLine if n == 1 then print 0 else putStr $ unlines $ map show $ solve n d xs solve :: Int -> Int -> [Int] -> [Int] solve n d xs = map f ys where -- ys :: [(Int, [Int])] ys = part xs -- f :: (Int, [Int]) -> Int f (a, zs) = length $ filter (\x -> a - x >= d) zs part :: [Int] -> [(Int, [Int])] part [x] = [(x, [])] part (x:xs) = (x, xs) : map (\(y, ys) -> (y, x:ys)) (part xs)