結果

問題 No.82 市松模様
ユーザー 👑 はまやんはまやんはまやんはまやん
提出日時 2018-06-09 13:43:58
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 603 bytes
コンパイル時間 13,158 ms
コンパイル使用メモリ 210,892 KB
実行使用メモリ 4,480 KB
最終ジャッジ日時 2023-09-13 01:49:58
合計ジャッジ時間 13,853 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

package main

import (
    "fmt"
)

func main() {
    var (
        h	int
        w	int
        c	string
        cc	string
    )
    fmt.Scan(&h)
    fmt.Scan(&w)
    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 == 0 && x % 2 == 0) {
                fmt.Print(c)
            } else if (y % 2 == 1 && x % 2 == 1) {
                fmt.Print(c)
            } else {
                fmt.Print(cc)
            }
            
        }
        
        fmt.Println("")
    }
}
0