結果

問題 No.82 市松模様
ユーザー mits58mits58
提出日時 2016-07-02 14:42:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 194 ms / 5,000 ms
コード長 389 bytes
コンパイル時間 2,185 ms
コンパイル使用メモリ 74,336 KB
実行使用メモリ 54,548 KB
最終ジャッジ日時 2024-04-20 05:45:09
合計ジャッジ時間 4,358 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
54,212 KB
testcase_01 AC 135 ms
54,092 KB
testcase_02 AC 133 ms
54,256 KB
testcase_03 AC 131 ms
54,144 KB
testcase_04 AC 140 ms
54,180 KB
testcase_05 AC 137 ms
54,096 KB
testcase_06 AC 144 ms
53,944 KB
testcase_07 AC 157 ms
54,180 KB
testcase_08 AC 184 ms
54,548 KB
testcase_09 AC 194 ms
54,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			int w=sc.nextInt();
			int h=sc.nextInt();
			char c1=(sc.next()).charAt(0);
			char c2= c1=='W' ? 'B' : 'W';
			for(int i=0;i<h;i++){
				for(int j=0;j<w;j++) System.out.print((i+j)%2==0 ? c1 : c2);
				System.out.println();
			}
		}
	}
}
0