結果
| 問題 |
No.82 市松模様
|
| コンテスト | |
| ユーザー |
明智重蔵
|
| 提出日時 | 2015-08-15 06:27:33 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 5,000 ms |
| コード長 | 1,378 bytes |
| コンパイル時間 | 885 ms |
| コンパイル使用メモリ | 106,880 KB |
| 実行使用メモリ | 18,944 KB |
| 最終ジャッジ日時 | 2024-07-18 09:34:23 |
| 合計ジャッジ時間 | 1,708 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;
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();
}
}
}
明智重蔵