結果

問題 No.82 市松模様
ユーザー wightou
提出日時 2025-06-17 05:09:50
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 681 bytes
コンパイル時間 3,167 ms
コンパイル使用メモリ 279,496 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-17 05:09:54
合計ジャッジ時間 4,216 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

/////////////////// メイン ///////////////////

int main () {
  
  //////////////////// 入力 ////////////////////

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

  //////////////// 出力変数定義 ////////////////

  vector<string> result(h,string(w,c));

  //////////////////// 処理 ////////////////////

  for (int i=0; i<h; i++) {
    for (int j=0; j<w; j++) {
      if ((i+j)%2) result.at(i).at(j) = 'W'-c+'B';
    }
  }

  //////////////////// 出力 ////////////////////

  for (size_t i=0; i<result.size(); i++) {
    cout << result.at(i) << endl;
  }

  //////////////////// 終了 ////////////////////

  return 0;

}
0