結果

問題 No.82 市松模様
ユーザー siguma323siguma323
提出日時 2016-05-18 13:05:54
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 609 bytes
コンパイル時間 551 ms
コンパイル使用メモリ 64,588 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 22:53:34
合計ジャッジ時間 1,084 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <fstream>
#include <queue>
#include <cstring>
using namespace std;

using ll = long long;
using ull = unsigned long long;

using P = pair<ll,ll>;

int main()
{
  char gara[2] = {'B','W'};

  int w,h;
  char c;
  cin >> w >> h >> c;

  int index = 0;
  if(c == 'W')
    index = 1;

  int tmp_index = index^1;

  for(int y = 0; y < h; ++y)
  {
    for(int x = 0; x < w; ++x)
    {
      cout << gara[index];
      index ^= 1;
    }

    index = tmp_index;
    tmp_index = index^1;

    cout << endl;
  }
}
0