結果
問題 |
No.82 市松模様
|
ユーザー |
|
提出日時 | 2017-04-11 20:03:56 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 165 ms / 5,000 ms |
コード長 | 434 bytes |
コンパイル時間 | 2,124 ms |
コンパイル使用メモリ | 76,356 KB |
実行使用メモリ | 42,188 KB |
最終ジャッジ日時 | 2024-07-18 09:06:01 |
合計ジャッジ時間 | 3,739 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
import java.util.Scanner; class N082{ public static void main(String args[]){ Scanner s = new Scanner(System.in); int w = s.nextInt(); int h = s.nextInt(); String a = s.next(); String b; for(int i = 0; i < h; i++){ b = a.equals("B") ? "W" : "B"; for(int j = 0; j < w / 2; j++){ System.out.print(a+b); } if(w % 2 != 0){ System.out.println(a); }else{ System.out.println(); } a = b; } } }