結果
| 問題 |
No.504 ゲーム大会(ランキング)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-13 22:47:14 |
| 言語 | Haskell (9.10.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 480 bytes |
| コンパイル時間 | 4,444 ms |
| コンパイル使用メモリ | 180,324 KB |
| 実行使用メモリ | 32,924 KB |
| 最終ジャッジ日時 | 2024-07-01 04:33:04 |
| 合計ジャッジ時間 | 8,237 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 TLE * 1 -- * 7 |
コンパイルメッセージ
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
ソースコード
module Main where
import Control.Monad
import Data.List
import Text.Printf (printf)
import qualified Data.ByteString.Char8 as B
readi :: B.ByteString -> Int
readi bs | Just (n, _) <- B.readInt bs = n
f :: Int -> [Int] -> Int -> [Int]
f k xs y
| y > k = y : xs
| otherwise = xs
main :: IO ()
main = do
n <- readLn
(k:as) <- replicateM n $ do
readi <$> B.getLine
let ss = scanl (f k) [] as
let rs = fmap ((+ 1) . length) ss
mapM_ print rs