結果
問題 |
No.82 市松模様
|
ユーザー |
![]() |
提出日時 | 2019-11-16 18:39:19 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 29 ms / 5,000 ms |
コード長 | 1,700 bytes |
コンパイル時間 | 1,315 ms |
コンパイル使用メモリ | 109,148 KB |
実行使用メモリ | 26,128 KB |
最終ジャッジ日時 | 2024-09-25 03:06:24 |
合計ジャッジ時間 | 1,644 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; namespace ConsoleApp11 { class Program { static void Main(string[] args) { int count = 0; var input = Console.ReadLine().Split(' '); int W = int.Parse(input[0]); int H = int.Parse(input[1]); string C = input[2]; for(int i = 0; i < H; i++) { while (true) { if(C == "B") { Console.Write("B"); count++; if(count >= W) { break; } Console.Write("W"); count++; if(count >= W) { break; } } if(C == "W") { Console.Write("W"); count++; if(count >= W) { break; } Console.Write("B"); count++; if(count >= W) { break; } } } if(C == "W") { C = "B"; } else if(C == "B") { C = "W"; } Console.WriteLine(); count = 0; } } } }