結果

問題 No.82 市松模様
ユーザー huffman56huffman56
提出日時 2022-06-19 17:04:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 24 ms / 5,000 ms
コード長 1,312 bytes
コンパイル時間 693 ms
コンパイル使用メモリ 110,488 KB
実行使用メモリ 25,376 KB
最終ジャッジ日時 2024-04-20 01:13:59
合計ジャッジ時間 1,376 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
24,992 KB
testcase_01 AC 22 ms
24,948 KB
testcase_02 AC 23 ms
24,876 KB
testcase_03 AC 23 ms
25,376 KB
testcase_04 AC 22 ms
22,712 KB
testcase_05 AC 23 ms
25,112 KB
testcase_06 AC 23 ms
25,072 KB
testcase_07 AC 23 ms
22,700 KB
testcase_08 AC 24 ms
24,988 KB
testcase_09 AC 23 ms
25,004 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using static System.Console;


namespace yukicoder
{
    class Program
    {
        static void Main()
        {
            var t = Console.ReadLine().Split().ToArray();
            var w = int.Parse(t[0]);
            var h = int.Parse(t[1]);
            var c = t[2];
            var str = c;

            for (var i = 0; i < h; i++)
            {
                for (var j = 0; j < w; j++)
                {
                    if (j == 0)
                    {
                        continue;
                    }

                    if (str[j-1] == 'B')
                    {
                        str += 'W';
                    }
                    else
                    {
                        str += 'B';
                    }
                }

                Console.WriteLine(str);

                if(str[0] == 'B')
                {
                    str = "W";
                }
                else
                {
                    str = "B";
                }
            }
        }
        
    }
}
0