結果

問題 No.82 市松模様
コンテスト
ユーザー wightou
提出日時 2025-06-17 05:09:50
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 968µs
コード長 681 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,527 ms
コンパイル使用メモリ 341,076 KB
実行使用メモリ 9,844 KB
最終ジャッジ日時 2026-11-21 06:13:33
合計ジャッジ時間 4,123 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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