結果
問題 |
No.82 市松模様
|
ユーザー |
![]() |
提出日時 | 2016-02-19 00:21:52 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 495 bytes |
コンパイル時間 | 586 ms |
コンパイル使用メモリ | 100,516 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 02:56:01 |
合計ジャッジ時間 | 1,071 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
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"]; foreach (h; 0 .. H) { foreach (w; 0 .. W) { color[cur].write; cur = (cur + 1) % 2; } writeln; cur = (cur + W + 1) % 2; } }