結果

問題 No.82 市松模様
ユーザー papipenpapipen
提出日時 2017-04-11 20:03:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 180 ms / 5,000 ms
コード長 434 bytes
コンパイル時間 2,137 ms
コンパイル使用メモリ 74,392 KB
実行使用メモリ 56,032 KB
最終ジャッジ日時 2023-09-25 11:16:03
合計ジャッジ時間 4,454 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,584 KB
testcase_01 AC 125 ms
55,440 KB
testcase_02 AC 126 ms
55,860 KB
testcase_03 AC 122 ms
56,000 KB
testcase_04 AC 127 ms
55,604 KB
testcase_05 AC 125 ms
55,792 KB
testcase_06 AC 129 ms
55,868 KB
testcase_07 AC 134 ms
55,976 KB
testcase_08 AC 168 ms
56,032 KB
testcase_09 AC 180 ms
55,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
class N082{
	public static void main(String args[]){
		Scanner s = new Scanner(System.in);
		int w = s.nextInt();
		int h = s.nextInt();
		String a = s.next();
		String b;
		for(int i = 0; i < h; i++){
			b = a.equals("B") ? "W" : "B";
			for(int j = 0; j < w / 2; j++){
				System.out.print(a+b);
			}
			if(w % 2 != 0){
				System.out.println(a);
			}else{
				System.out.println();
			}
			a = b;
		}
	}
}
0