結果

問題 No.82 市松模様
ユーザー curryudon08curryudon08
提出日時 2020-06-23 17:19:58
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 713 bytes
コンパイル時間 2,063 ms
コンパイル使用メモリ 102,236 KB
実行使用メモリ 22,816 KB
最終ジャッジ日時 2023-09-16 20:01:06
合計ジャッジ時間 3,297 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,860 KB
testcase_01 AC 55 ms
22,708 KB
testcase_02 AC 55 ms
18,816 KB
testcase_03 AC 56 ms
22,752 KB
testcase_04 AC 54 ms
18,676 KB
testcase_05 AC 58 ms
22,816 KB
testcase_06 AC 57 ms
20,732 KB
testcase_07 AC 58 ms
20,768 KB
testcase_08 AC 60 ms
20,660 KB
testcase_09 AC 58 ms
20,928 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace _0082
{
    class Program
    {
        static void Main(string[] args)
        {
            var _ = Console.ReadLine().Split();
            var w = int.Parse(_[0]);
            var h = int.Parse(_[1]);
            var c = _[2];

            var m1 = c.Equals("B") ? "BW" : "WB";
            var m2 = c.Equals("B") ? "WB" : "BW";

            for(var i = 0; i < h; i++){
                for(var j = 0; j < w; j++){
                    if(i % 2 == 0){
                        Console.Write(m1[j % 2]);
                    }else{
                        Console.Write(m2[j % 2]);
                    }
                }
                Console.Write("\n");
            }
        }
    }
}
0