結果

問題 No.82 市松模様
ユーザー itok217itok217
提出日時 2017-05-28 16:48:17
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 777 bytes
コンパイル時間 826 ms
コンパイル使用メモリ 108,952 KB
実行使用メモリ 24,216 KB
最終ジャッジ日時 2023-10-21 13:54:33
合計ジャッジ時間 1,799 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
24,208 KB
testcase_01 AC 24 ms
24,208 KB
testcase_02 AC 25 ms
24,208 KB
testcase_03 AC 24 ms
24,208 KB
testcase_04 AC 24 ms
24,208 KB
testcase_05 AC 24 ms
24,208 KB
testcase_06 AC 25 ms
24,208 KB
testcase_07 AC 24 ms
24,208 KB
testcase_08 AC 24 ms
24,216 KB
testcase_09 AC 25 ms
24,216 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.Linq;
using System.Text;
using System.Collections.Generic;

class Program {
    static void Main() {
        string[] s = Console.ReadLine().Split();
        int w = int.Parse(s[0]);
        int h = int.Parse(s[1]);
        char a, b;
        if (s[2] == "B") {
            a = 'B';
            b = 'W';
        } else {
            a = 'W';
            b = 'B';
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                if ((i + j) % 2 == 0) {
                    sb.Append(a);
                } else {
                    sb.Append(b);
                }
            }
            sb.Append('\n');
        }
        Console.Write(sb.ToString());
    }
}
0