結果
| 問題 |
No.82 市松模様
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-04-03 00:44:29 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 376 bytes |
| コンパイル時間 | 335 ms |
| コンパイル使用メモリ | 5,248 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-02 12:31:42 |
| 合計ジャッジ時間 | 919 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 7 |
ソースコード
-- yukicoder My Practice
-- author: Leonardone @ NEETSDKASU
w = io.stdin:read("*n")
h = io.stdin:read("*n")
c = io.read():match('%S')
if c == 'B' then
d = 'W'
else
d = 'B'
end
s = ''
for i = 1, h do
if i % 2 == 0 then
k = 1
else
k = 0
end
for j = 1, w do
if k == 0 then
s = s .. c
else
s = s .. d
end
k = 1 - k
end
s = s .. "\n"
end
print(s)