結果
| 問題 | No.2728 Grid Expansion |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-04 01:29:28 |
| 言語 | Standard ML (MLton 20241230) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,164 bytes |
| 記録 | |
| コンパイル時間 | 5,829 ms |
| コンパイル使用メモリ | 704,488 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-04 01:29:39 |
| 合計ジャッジ時間 | 6,631 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
ソースコード
fun readInt () =
valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn)
fun readStr () =
let
fun scan reader stream = SOME (StringCvt.splitl (not o Char.isSpace) reader (StringCvt.skipWS reader stream))
in
valOf (TextIO.scanStream scan TextIO.stdIn)
end
fun listChNTimes 0 _ = []
| listChNTimes n ch =
ch :: listChNTimes (n - 1) ch
fun printStringNTimes 0 _ = ignore ()
| printStringNTimes n s =
(
print (s ^ "\n");
printStringNTimes (n - 1) s
)
fun printAns _ [] = ignore ()
| printAns k (h::tl) =
let
val unit = String.implode
(List.rev (List.foldl (fn (ch, acc) =>
listChNTimes k ch @ acc)
[]
(String.explode h)))
in
(
printStringNTimes k unit;
printAns k tl
)
end
val () =
let
val n = readInt ()
val k = readInt ()
val aMatrix = List.tabulate (n, fn _ => readStr ())
in
printAns k aMatrix
end