結果
問題 |
No.1169 Row and Column and Diagonal
|
ユーザー |
![]() |
提出日時 | 2020-08-15 00:51:30 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 400 bytes |
コンパイル時間 | 11,053 ms |
コンパイル使用メモリ | 178,048 KB |
実行使用メモリ | 8,064 KB |
最終ジャッジ日時 | 2024-10-10 16:58:41 |
合計ジャッジ時間 | 10,717 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
コンパイルメッセージ
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.Monad as M main :: IO () main = do n <- readLn :: IO Int let m = (n `div` 2) + 1 M.forM_ [1..n] $ \i -> do putStrLn $ unwords . map show $ shift (i - 1) $ merge [1..m] [m+1..n] merge :: [a] -> [a] -> [a] merge xs [] = xs merge [] ys = ys merge (x:xs) (y:ys) = x : y : merge xs ys shift :: Int -> [Int] -> [Int] shift n xs = drop n xs ++ take n xs