結果
問題 | No.82 市松模様 |
ユーザー |
|
提出日時 | 2016-08-27 16:35:30 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 458 bytes |
コンパイル時間 | 593 ms |
コンパイル使用メモリ | 100,568 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 03:44:03 |
合計ジャッジ時間 | 1,078 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
import std.algorithm, std.array, std.range;import std.string, std.conv;import std.math;import std.stdio, std.typecons;void main(){auto rd = readln.split;auto w = rd[0].to!int;auto h = rd[1].to!int;auto c = rd[2];foreach (i; 0..h) {writeLine(w, c);c = rev(c);}}void writeLine(int w, string c){foreach (i; 0..w) {write(c);c = rev(c);}writeln;}string rev(string c){return c == "B" ? "W" : "B";}