結果

問題 No.82 市松模様
ユーザー SuunnSuunn
提出日時 2018-11-20 06:09:33
言語 Java19
(openjdk 21)
結果
AC  
実行時間 176 ms / 5,000 ms
コード長 471 bytes
コンパイル時間 2,102 ms
コンパイル使用メモリ 71,992 KB
実行使用メモリ 56,524 KB
最終ジャッジ日時 2023-08-26 02:11:51
合計ジャッジ時間 4,239 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,056 KB
testcase_01 AC 122 ms
56,180 KB
testcase_02 AC 120 ms
56,048 KB
testcase_03 AC 120 ms
55,768 KB
testcase_04 AC 126 ms
53,816 KB
testcase_05 AC 123 ms
55,836 KB
testcase_06 AC 129 ms
55,588 KB
testcase_07 AC 142 ms
56,016 KB
testcase_08 AC 168 ms
56,004 KB
testcase_09 AC 176 ms
56,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
	

public class Main{
	
	
	public static void main(String args[])throws Exception{
		
		Scanner sc = new Scanner(System.in);
		int W = sc.nextInt();
		int H = sc.nextInt();
		String c = sc.next();
		char C = c.charAt(0);
		char notC = (char) ('B' + 'W' - C);
		for(int i=0;i<H;i++){
			for(int j=0;j<W;j++){
				if((i+j)%2==0){
					System.out.print(C);
				}else{
					System.out.print(notC);
				}
			}
			System.out.println();
		}
		
		
	}
}
0