結果

問題 No.82 市松模様
ユーザー RabbitCPRabbitCP
提出日時 2015-08-08 21:32:00
言語 D
(dmd 2.106.1)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 813 bytes
コンパイル時間 541 ms
コンパイル使用メモリ 83,488 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-02 20:19:37
合計ジャッジ時間 1,236 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

/*****************************
 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;
}
0