結果

問題 No.82 市松模様
ユーザー himo
提出日時 2019-09-24 18:35:26
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 1,343 ms
コンパイル使用メモリ 159,744 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 05:12:57
合計ジャッジ時間 1,945 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 4 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
int h,w;
char z;
cin >> h >>w >>z;
string s;
if(z=='B'){
for(int i=0;i<h;i++){
    if(i%2==0)s+='B';
    else s+='W';
}
}
else{
for(int i=0;i<h;i++){
    if(i%2==0)s+='W';
    else s+='B';
}
}
for(int i=0;i<w;i++){
    if(i%2==0)cout <<s<<endl;
    else {
        string z;
        z=s;
        reverse(z.begin(),z.end());
        cout <<z <<endl;
    }
}
}
0