結果

問題 No.82 市松模様
ユーザー syokeininsyokeinin
提出日時 2014-12-02 23:43:17
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 482 bytes
コンパイル時間 1,888 ms
コンパイル使用メモリ 71,168 KB
実行使用メモリ 58,796 KB
最終ジャッジ日時 2023-09-02 01:11:12
合計ジャッジ時間 4,015 ms
ジャッジサーバーID
(参考情報)
judge16 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 116 ms
56,216 KB
testcase_03 AC 119 ms
56,008 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt();
		int h = sc.nextInt();
		String c = sc.next();
		sc.close();
		for(int i = 0; i < w; i++){
			for(int j = 0; j < h; j++){
				System.out.print(c);
				c = next(c);
			}
			System.out.println();
		}
	}
	public static String next(String c){
		if(c.equals("B")){
			return "W";
		}else{
			return "B";
		}
	}
}
0