結果

問題 No.82 市松模様
ユーザー scachescache
提出日時 2014-12-02 23:24:07
言語 Java19
(openjdk 21)
結果
AC  
実行時間 181 ms / 5,000 ms
コード長 541 bytes
コンパイル時間 3,154 ms
コンパイル使用メモリ 72,060 KB
実行使用メモリ 56,384 KB
最終ジャッジ日時 2023-09-02 01:02:12
合計ジャッジ時間 5,336 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,680 KB
testcase_01 AC 127 ms
56,044 KB
testcase_02 AC 125 ms
56,164 KB
testcase_03 AC 122 ms
56,284 KB
testcase_04 AC 132 ms
55,820 KB
testcase_05 AC 125 ms
56,228 KB
testcase_06 AC 131 ms
56,384 KB
testcase_07 AC 149 ms
56,340 KB
testcase_08 AC 181 ms
56,300 KB
testcase_09 AC 168 ms
56,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main82 {
	public static void main(String[] args) {
		Main82 p = new Main82();
	}

	public Main82() {
		Scanner sc = new Scanner(System.in);
		int W = sc.nextInt();
		int H = sc.nextInt();
		char[] c = new char[2];
		c[0] = sc.next().charAt(0);
		c[1] = c[0]=='W' ? 'B' : 'W';
		solve(W, H, c);
	}

	public void solve(int w, int h, char[] c) {
		
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				System.out.print((c[(i+j)%2]));
			}
			System.out.println();
		}
	}

}
0