結果

問題 No.82 市松模様
コンテスト
ユーザー scache
提出日時 2014-12-02 23:24:07
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 82 ms / 5,000 ms
+ 926µs
コード長 541 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,146 ms
コンパイル使用メモリ 84,384 KB
実行使用メモリ 43,976 KB
最終ジャッジ日時 2026-07-25 09:04:02
合計ジャッジ時間 3,802 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.Scanner;

public class Main82 {
	public static void main(String[] args) {
		Main82 p = new Main82();
	}

	public Main82() {
		Scanner sc = new Scanner(System.in);
		int W = sc.nextInt();
		int H = sc.nextInt();
		char[] c = new char[2];
		c[0] = sc.next().charAt(0);
		c[1] = c[0]=='W' ? 'B' : 'W';
		solve(W, H, c);
	}

	public void solve(int w, int h, char[] c) {
		
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				System.out.print((c[(i+j)%2]));
			}
			System.out.println();
		}
	}

}
0