結果

問題 No.1798 Financial Quiz
ユーザー norioc
提出日時 2026-10-25 14:16:01
言語 Haskell
(9.14.1 + ACL)
コンパイル:
ghc -rtsopts -with-rtsopts=-K1G -o a.out -O2 _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
+ 784µs
コード長 1,744 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 10,938 ms
コンパイル使用メモリ 218,112 KB
実行使用メモリ 9,820 KB
最終ジャッジ日時 2026-10-25 14:16:28
合計ジャッジ時間 12,512 ms
ジャッジサーバーID
(参考情報)
judge7_0 / judge6_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #
raw source code

{-# LANGUAGE BlockArguments #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-top-binds #-}
{-# OPTIONS_GHC -Wno-missing-signatures #-}

import Control.Monad
import Control.Monad.State.Strict
import Control.Applicative
import Data.Bool
import Data.Function
import Data.List
import Data.Ord
import Data.List.Split
import Debug.Trace
import qualified Data.Char as C
-- import qualified Data.Set as Set
-- import qualified Data.Map.Strict as M
import qualified Data.ByteString.Char8 as BS
import qualified Data.Vector as V

input = getLine :: IO String
ii = readLn :: IO Int
li = unfoldr (BS.readInt . BS.dropWhile C.isSpace) <$> BS.getLine

printYn b = putStrLn $ bool "No" "Yes" b

printList :: Show a => [a] -> IO ()
printList = putStrLn . unwords . map show
puts = putStrLn

divmod x y = (x `div` y, x `mod` y)

rep = replicate
repM :: Applicative m => Int -> m a -> m [a]
repM = replicateM
repM_ :: Applicative m => Int -> m a -> m ()
repM_ = replicateM_

-- chunksOf
chunkBy = groupBy

fold :: Foldable t => (b -> a -> b) -> b -> t a -> b
fold = foldl'

pairwise :: [a] -> [(a, a)]
pairwise xs = zip xs (drop 1 xs)

windows :: Int -> [a] -> [[a]]
windows size xs
  | length w < size = []
  | otherwise = w : windows size (drop 1 xs)
  where
    w = take size xs

countIf f = length . filter f

minmax (x:xs) = foldl' f (x, x) xs
  where
    f (mi, ma) x = (min mi x, max ma x)

class Indexable c where
  at :: Int -> c a -> a

instance Indexable [] where
  at i xs = xs !! i

instance Indexable V.Vector where
  at i v = v V.! i

f s =
  let n = length s `div` 2
      a = take n s
      b = take n $ reverse s
  in countIf (uncurry (/=)) $ zip a b

main = do
  [n, p] <- li
  let ans = n - n * p `div` 100
  print ans
0