結果
| 問題 |
No.82 市松模様
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-08-23 02:37:32 |
| 言語 | Standard ML (MLton 20210117) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,182 bytes |
| コンパイル時間 | 3,308 ms |
| コンパイル使用メモリ | 689,148 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-08-23 02:37:36 |
| 合計ジャッジ時間 | 4,128 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 1 |
ソースコード
fun readInt () =
valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn)
fun readChar () = valOf (TextIO.scanStream Char.scan TextIO.stdIn)
val () =
let
val w = readInt ()
val h = readInt ()
val c = readChar ()
fun printAns () =
let
fun makeLine 0 _ = []
| makeLine n ch =
if ch = #"B" then #"W" :: makeLine (n - 1) #"W"
else #"B" :: makeLine (n - 1) #"B"
fun makeLines 0 _ = ignore ()
| makeLines n ch =
if ch = #"B"
then
(
print (String.implode (List.rev (makeLine w #"W")) ^ "\n");
makeLines (n - 1) #"W"
)
else
(
print (String.implode (List.rev (makeLine w #"B")) ^ "\n");
makeLines (n - 1) #"B"
)
in
makeLines h c
end
in
printAns ()
end