結果

問題 No.82 市松模様
ユーザー spaciaspacia
提出日時 2015-12-29 16:31:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 5,000 ms
コード長 647 bytes
コンパイル時間 2,051 ms
コンパイル使用メモリ 74,376 KB
実行使用メモリ 54,764 KB
最終ジャッジ日時 2023-10-19 12:21:04
合計ジャッジ時間 3,652 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
53,572 KB
testcase_01 AC 55 ms
53,572 KB
testcase_02 AC 60 ms
53,568 KB
testcase_03 AC 54 ms
52,500 KB
testcase_04 AC 58 ms
53,588 KB
testcase_05 AC 54 ms
53,568 KB
testcase_06 AC 57 ms
53,592 KB
testcase_07 AC 64 ms
53,596 KB
testcase_08 AC 112 ms
52,916 KB
testcase_09 AC 116 ms
54,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.math.*;

class Main82 {
	
	public static void out (Object out) {
		System.out.println(out);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		String[] line = br.readLine().split(" ");
		int w = Integer.parseInt(line[0]);
		int h = Integer.parseInt(line[1]);
		boolean startB = line[2].equals("B");
		
		for (int i = 0; i < h; i++) {
			boolean flg = startB;
			for (int j = 0; j < w; j++) {
				System.out.print(flg ? "B" : "W");
				flg = !flg;
			}
			out("");
			startB = !startB;
		}
		
	}
}
0