結果
| 問題 | 
                            No.82 市松模様
                             | 
                    
| コンテスト | |
| ユーザー | 
                             RabbitCP
                         | 
                    
| 提出日時 | 2015-08-08 21:32:00 | 
| 言語 | D  (dmd 2.109.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 813 bytes | 
| コンパイル時間 | 912 ms | 
| コンパイル使用メモリ | 94,656 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-06-12 02:42:45 | 
| 合計ジャッジ時間 | 1,358 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 3 | 
| other | WA * 7 | 
ソースコード
/*****************************
 Name         : Yoshitak
 Create Date  : 2015/08/08
 Program Name : main.d
 Problem No.  : 82
*****************************/
/*---------------------
 import
-----------------------*/
import std.stdio;
import std.string;
import std.conv;
import std.array;
/*---------------------
 main
-----------------------*/
int main(string[] args)
{
	//input
	string[] input;
	string[2] color_val = ["W", "B"];
	input = split(chomp(readln()));
	
	//into the value
	uint w, h, color;
  w = to!int(input[0]);
  h = to!int(input[1]);
  if(input[2] == "W"){
   color = 0; 
  }else{
   color = 1;
  }
  
	//output
	for(int i=0; i<h; i++){
		for(int j=0; j<w; j++){
			write(color_val[color]);
			color = (color + 1) % 2;
		}
		color = (color + w + 1) % 2;
		writeln();
	}
	writeln();
	
	return 0;
}
            
            
            
        
            
RabbitCP