結果

問題 No.82 市松模様
ユーザー fal_rndfal_rnd
提出日時 2017-08-08 18:44:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 161 ms / 5,000 ms
コード長 400 bytes
コンパイル時間 2,448 ms
コンパイル使用メモリ 76,796 KB
実行使用メモリ 42,592 KB
最終ジャッジ日時 2024-04-20 05:15:09
合計ジャッジ時間 4,166 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
42,540 KB
testcase_01 AC 147 ms
42,316 KB
testcase_02 AC 112 ms
41,116 KB
testcase_03 AC 111 ms
41,172 KB
testcase_04 AC 116 ms
41,064 KB
testcase_05 AC 152 ms
42,272 KB
testcase_06 AC 133 ms
42,224 KB
testcase_07 AC 132 ms
42,304 KB
testcase_08 AC 161 ms
42,592 KB
testcase_09 AC 153 ms
42,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class M{
	static Scanner s=new Scanner(System.in);
	static int getInt(){return Integer.parseInt(s.next());}
	public static void main(String[]$){
		int w=getInt(),h=getInt();
		char c=s.next().charAt(0);
		for(int i=0;i<h;++i) {
			String v=String.valueOf(c);
			for(int j=1;j<w;++j) {
				v+=v.charAt(j-1)=='B'?'W':'B';
			}
			c=c=='B'?'W':'B';
			System.out.println(v);
		}
	}
}
0