結果

問題 No.82 市松模様
ユーザー 👑 はまやんはまやんはまやんはまやん
提出日時 2018-06-09 13:45:42
言語 Go
(1.22.1)
結果
AC  
実行時間 5 ms / 5,000 ms
コード長 513 bytes
コンパイル時間 12,066 ms
コンパイル使用メモリ 210,276 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 01:50:15
合計ジャッジ時間 11,735 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 5 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
    "fmt"
)

func main() {
    var (
        h	int
        w	int
        c	string
        cc	string
    )
    fmt.Scan(&w)
    fmt.Scan(&h)
    fmt.Scan(&c)
    
    if c == "W" {
        cc = "B"
    } else {
        cc = "W"
    }
    
    for y := 0; y < h; y++ {
        for x := 0; x < w; x++ {
            if(y % 2 == x % 2) {
                fmt.Print(c)
            } else {
                fmt.Print(cc)
            }
            
        }
        
        fmt.Println("")
    }
}
0