結果

問題 No.82 市松模様
ユーザー mbanmban
提出日時 2016-11-07 12:41:50
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 753 bytes
コンパイル時間 3,366 ms
コンパイル使用メモリ 104,244 KB
実行使用メモリ 22,668 KB
最終ジャッジ日時 2023-08-16 14:19:06
合計ジャッジ時間 4,029 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
22,668 KB
testcase_01 AC 55 ms
20,752 KB
testcase_02 AC 56 ms
20,780 KB
testcase_03 AC 55 ms
20,688 KB
testcase_04 AC 56 ms
20,776 KB
testcase_05 AC 55 ms
22,616 KB
testcase_06 AC 54 ms
20,696 KB
testcase_07 AC 55 ms
20,592 KB
testcase_08 AC 58 ms
20,624 KB
testcase_09 AC 60 ms
20,648 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.Collections.Generic;
using System.Linq;

class Magatro
{
    static void Main()
    {
        int W, H;
        string c;
        string[] s = Console.ReadLine().Split(' ');
        W = int.Parse(s[0]);
        H = int.Parse(s[1]);
        c = s[2];
        string b = c == "B" ? "W" : "B";
        for(int i = 0; i < H; i++)
        {
            for(int j = 0; j < W; j++)
            {
                if (j % 2 == 0)
                {
                    Console.Write(c);

                }
                else
                {
                    Console.Write(b);
                }
            }
            Console.WriteLine();
            string q = b;
            b = c;
            c = q;
        }
      
    }
}
0