結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2014-12-03 00:44:29 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 420 bytes |
コンパイル時間 | 635 ms |
コンパイル使用メモリ | 101,624 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 01:42:48 |
合計ジャッジ時間 | 1,148 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
import std.stdio;import std.string;import std.conv;import std.range;//-------------------------void main(){auto line = readln.chomp.split(" ");int width = line[0].to!int;int height = line[1].to!int;auto design = "BW".cycle;auto start = (line[2] == "B") ? 0 : 1;foreach(i; 0..height){writeln(design.take(width + 1).array[start..start + width]);start = start^1;}}