結果
| 問題 | No.82 市松模様 |
| コンテスト | |
| ユーザー |
mban
|
| 提出日時 | 2016-11-07 12:41:50 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 18 ms / 5,000 ms |
| + 917µs | |
| コード長 | 753 bytes |
| 記録 | |
| コンパイル時間 | 444 ms |
| コンパイル使用メモリ | 112,396 KB |
| 実行使用メモリ | 26,776 KB |
| 最終ジャッジ日時 | 2026-09-29 15:48:13 |
| 合計ジャッジ時間 | 1,674 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 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;
}
}
}
mban