結果

問題 No.82 市松模様
ユーザー nCk_cvnCk_cv
提出日時 2016-02-01 19:45:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 194 ms / 5,000 ms
コード長 418 bytes
コンパイル時間 2,254 ms
コンパイル使用メモリ 77,588 KB
実行使用メモリ 57,640 KB
最終ジャッジ日時 2023-10-21 18:29:28
合計ジャッジ時間 4,741 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
57,352 KB
testcase_01 AC 137 ms
57,348 KB
testcase_02 AC 137 ms
57,352 KB
testcase_03 AC 136 ms
57,372 KB
testcase_04 AC 143 ms
57,612 KB
testcase_05 AC 141 ms
57,348 KB
testcase_06 AC 145 ms
57,596 KB
testcase_07 AC 168 ms
57,608 KB
testcase_08 AC 194 ms
57,608 KB
testcase_09 AC 189 ms
57,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;
import java.io.*;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt();
		int h = sc.nextInt();
		int sb = sc.next().toCharArray()[0] == 'B'?0:1;
		
		for(int i = 0; i < h; i++) {
			for(int j = 0; j < w; j++) {
				System.out.print(((i + j + sb) % 2 == 0?'B':'W'));
			}
			System.out.println();
		}
	}
}
0