結果

問題 No.82 市松模様
ユーザー karayuukarayuu
提出日時 2019-08-03 05:32:19
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 758 bytes
コンパイル時間 1,768 ms
コンパイル使用メモリ 165,384 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-18 18:36:58
合計ジャッジ時間 2,298 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

template <class T>
void copy(vector<T> from, vector<T> to) {
  copy(from.begin(), from.end(), back_inserter(to));
}

template <class T>
void sort(vector<T> a) {
  sort(a.begin(), a.end());
}

template <class T>
void input_to(vector<T> a) {
  T a_i;
  cin >> a_i;
  a.push_back(a_i);
}

int main() {
  int w, h;
  char c;
  cin >> w >> h >> c;

  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      if (c == 'B') {
        if ((i + j) % 2 == 0) {
          cout << "B";
        } else {
          cout << "W";
        }
      } else {
        if ((i + j) % 2 == 0) {
          cout << "W";
        } else {
          cout << "B";
        }
      }
    }
    cout << endl;
  }
  cout << endl;
}
0