結果

問題 No.82 市松模様
ユーザー YOSHIYOSHI
提出日時 2021-02-27 21:01:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 113 ms / 5,000 ms
コード長 599 bytes
コンパイル時間 2,915 ms
コンパイル使用メモリ 75,284 KB
実行使用メモリ 51,720 KB
最終ジャッジ日時 2024-04-10 15:50:34
合計ジャッジ時間 4,301 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
50,216 KB
testcase_01 AC 49 ms
50,080 KB
testcase_02 AC 49 ms
50,196 KB
testcase_03 AC 50 ms
50,332 KB
testcase_04 AC 52 ms
49,952 KB
testcase_05 AC 49 ms
50,112 KB
testcase_06 AC 53 ms
50,208 KB
testcase_07 AC 59 ms
49,960 KB
testcase_08 AC 113 ms
51,720 KB
testcase_09 AC 110 ms
51,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No00000082_Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] bwArr = new String[]{"B","W"};
		String[] arr = br.readLine().split(" ");
		int subIndex = ("B".equals(arr[2])) ? 0 : 1;
		for(int i = 0; i < Integer.parseInt(arr[1]) ; i++) {
			for(int j = 0; j < Integer.parseInt(arr[0]) ; j++) {
				System.out.print(bwArr[(i + j + subIndex) %2]);
			}
			System.out.println();
		}
	}

}
0