結果

問題 No.82 市松模様
ユーザー himohimo
提出日時 2019-09-24 18:35:26
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 2,586 ms
コンパイル使用メモリ 161,144 KB
実行使用メモリ 4,368 KB
最終ジャッジ日時 2023-10-19 09:00:04
合計ジャッジ時間 1,972 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

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