結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2017-12-06 10:12:55 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 31 ms / 5,000 ms |
コード長 | 1,693 bytes |
コンパイル時間 | 2,665 ms |
コンパイル使用メモリ | 112,092 KB |
実行使用メモリ | 26,264 KB |
最終ジャッジ日時 | 2024-11-29 00:55:48 |
合計ジャッジ時間 | 2,096 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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;using System.Text;using System.Threading.Tasks;namespace yukicoder_82 {class Program {static void Main(string[] args) {//B=66,W=87string[] s = Console.ReadLine().Split(' ');int w = int.Parse(s[0]);int h = int.Parse(s[1]);char c = char.Parse(s[2]);String[,]color = new string[h, w];if (c == 66) {for (int i = 0; i < h; i++) {for (int k = 0; k < w; k++) {if (i % 2 == 0) {if (k % 2 == 0) color[i, k] = "B";else color[i, k] = "W";} else {if (k % 2 == 0) color[i, k] = "W";else color[i, k] = "B";}}}} else {for (int i = 0; i < h; i++) {for (int k = 0; k < w; k++) {if (i % 2 == 0) {if (k % 2 == 0) color[i, k] = "W";else color[i, k] = "B";} else {if (k % 2 == 0) color[i, k] = "B";else color[i, k] = "W";}}}}for(int i = 0; i < h; i++) {for(int k = 0; k < w; k++) {Console.Write(color[i, k]);}Console.WriteLine();}Console.ReadLine();}}}