結果
| 問題 |
No.1130 Grid Numbers
|
| ユーザー |
|
| 提出日時 | 2024-05-05 19:41:54 |
| 言語 | Haskell (9.10.1) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 395 bytes |
| コンパイル時間 | 9,524 ms |
| コンパイル使用メモリ | 175,488 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-27 20:17:25 |
| 合計ジャッジ時間 | 7,254 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
コンパイルメッセージ
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 Control.Monad
import Data.List (sort)
main :: IO ()
main = do
[h, w] <- f
replicateM h f >>= solve w
where
f = map read <$> words <$> getLine
solve :: Int -> [[Int]] -> IO ()
solve w ass = f as
where
as = sort $ concat ass
f xs = do
case xs of
[] -> return ()
_ -> do
putStrLn $ unwords $ map show $ take w xs
f (drop w xs)