結果

問題 No.82 市松模様
ユーザー nak2yoshi
提出日時 2016-02-18 23:32:46
言語 D
(dmd 2.109.1)
結果
WA  
実行時間 -
コード長 421 bytes
コンパイル時間 1,046 ms
コンパイル使用メモリ 103,936 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 02:55:55
合計ジャッジ時間 1,160 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 5 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio,
       std.conv,
       std.string,
       std.range,
       std.math,
       std.algorithm;

void main()
{
    auto input = readln.split;
    auto W = input[0].to!int, H = input[1].to!int;
    auto C = input[2];

    auto cur = (C == "B" ? 0 : 1);
    auto color = ["B", "W"].cycle;
    iota(H)
        .tee!(a => writeln)
        .each!(h => iota(W)
               .each!(w => color[cur++].write));
}
0