結果
| 問題 |
No.82 市松模様
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-12-02 23:30:12 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 153 ms / 5,000 ms |
| コード長 | 595 bytes |
| コンパイル時間 | 3,568 ms |
| コンパイル使用メモリ | 75,496 KB |
| 実行使用メモリ | 41,460 KB |
| 最終ジャッジ日時 | 2024-06-11 07:43:28 |
| 合計ジャッジ時間 | 4,646 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
import java.util.*;
import static java.lang.Math.*;
public class ppp {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int m=sc.nextInt();
String c=sc.next();
int x=0;
if(c.equals("B"))x++;
char a[][]=new char[m][n];
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
if((i+j+x)%2==1){
a[i][j]='B';
}
else a[i][j]='W';
}
}
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
System.out.print(a[i][j]);
}
System.out.println();
}
}}