結果

問題 No.82 市松模様
ユーザー Pump0129Pump0129
提出日時 2018-03-30 04:05:39
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 288 ms / 5,000 ms
コード長 475 bytes
コンパイル時間 9,378 ms
コンパイル使用メモリ 429,276 KB
実行使用メモリ 57,172 KB
最終ジャッジ日時 2024-04-30 17:54:14
合計ジャッジ時間 12,751 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 253 ms
56,756 KB
testcase_01 AC 253 ms
56,812 KB
testcase_02 AC 252 ms
56,880 KB
testcase_03 AC 250 ms
56,704 KB
testcase_04 AC 252 ms
56,652 KB
testcase_05 AC 250 ms
56,728 KB
testcase_06 AC 254 ms
56,944 KB
testcase_07 AC 280 ms
57,068 KB
testcase_08 AC 288 ms
57,172 KB
testcase_09 AC 280 ms
57,084 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:3:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

package net.ipipip0129.kotlin.yukicoder

fun main(args: Array<String>) {
    val data = readLine()!!.split(" ")
    val width = data[0].toInt()
    val height = data[1].toInt()
    val isODD = width % 2 == 0
    var isBlack = data[2] == "B"

    for (j in 0 until height) {
        for (i in 0 until width) {
            print(if (isBlack) "B" else "W")
            isBlack = !isBlack
        }
        if (isODD) isBlack = !isBlack
        println()
    }
}
0