結果
| 問題 | 
                            No.82 市松模様
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-07-26 15:30:17 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 18 ms / 5,000 ms | 
| コード長 | 372 bytes | 
| コンパイル時間 | 1,917 ms | 
| コンパイル使用メモリ | 192,816 KB | 
| 最終ジャッジ日時 | 2025-01-07 07:34:57 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 7 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int w, h;
    char c, d;
    cin >> w >> h >> c;
    if (c == 'B') d = 'W';
    else d = 'B';
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if ((i+j)%2==0) cout << c;
            else cout << d;
        }
        cout << endl;
    }
    return 0;
}