結果
問題 | No.82 市松模様 |
ユーザー |
|
提出日時 | 2019-11-17 15:30:07 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 31 ms / 5,000 ms |
コード長 | 851 bytes |
コンパイル時間 | 1,117 ms |
コンパイル使用メモリ | 112,500 KB |
実行使用メモリ | 25,696 KB |
最終ジャッジ日時 | 2024-09-25 05:57:10 |
合計ジャッジ時間 | 1,765 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;using System.Collections.Generic;using System.Linq;class Yuki0082{static int w, h;static char c;static void Solve(){string cells;if(c == 'W') cells = "WB";else cells = "BW";for(var i = 0; i != h; ++i) {for(var j = 0; j != w; ++j) {if(i % 2 == 0) {Console.Write(j % 2 == 0 ? cells[0] : cells[1]);}else {Console.Write(j % 2 == 0 ? cells[1] : cells[0]);}}Console.WriteLine();}}static void Scan(){var buf = Console.ReadLine().Split();w = int.Parse(buf[0]);h = int.Parse(buf[1]);c = buf[2][0];}static void Main(){Scan();Solve();}}