結果
問題 | No.82 市松模様 |
ユーザー | 明智重蔵 |
提出日時 | 2015-08-15 06:27:33 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 64 ms / 5,000 ms |
コード長 | 1,378 bytes |
コンパイル時間 | 2,286 ms |
コンパイル使用メモリ | 103,832 KB |
実行使用メモリ | 23,804 KB |
最終ジャッジ日時 | 2023-09-25 11:55:48 |
合計ジャッジ時間 | 3,538 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 59 ms
21,876 KB |
testcase_01 | AC | 58 ms
23,672 KB |
testcase_02 | AC | 59 ms
23,804 KB |
testcase_03 | AC | 59 ms
21,772 KB |
testcase_04 | AC | 60 ms
23,660 KB |
testcase_05 | AC | 58 ms
21,764 KB |
testcase_06 | AC | 59 ms
21,796 KB |
testcase_07 | AC | 59 ms
21,800 KB |
testcase_08 | AC | 64 ms
21,760 KB |
testcase_09 | AC | 64 ms
21,572 KB |
コンパイルメッセージ
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 Program { static string InputPattern = "Input4"; static List<string> GetInputList() { var WillReturn = new List<string>(); if (InputPattern == "Input1") { WillReturn.Add("4 3 B"); //BWBW //WBWB //BWBW } else if (InputPattern == "Input2") { WillReturn.Add("3 4 W"); //WBW //BWB //WBW //BWB } else if (InputPattern == "Input3") { WillReturn.Add("1 1 W"); //W } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List<string> InputList = GetInputList(); string[] wkArr = InputList[0].Split(' ').ToArray(); int W = int.Parse(wkArr[0]); int H = int.Parse(wkArr[1]); char C = char.Parse(wkArr[2]); for (int Y = 0; Y <= H - 1; Y++) { for (int X = 0; X <= W - 1; X++) { bool IsEven = ((X + Y) % 2 == 0); if (C == 'B') Console.Write(IsEven ? 'B' : 'W'); else Console.Write(IsEven ? 'W' : 'B'); } Console.WriteLine(); } } }