結果

問題 No.82 市松模様
ユーザー focus
提出日時 2018-01-23 23:44:40
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 672 bytes
コンパイル時間 678 ms
コンパイル使用メモリ 63,832 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 03:54:46
合計ジャッジ時間 1,407 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 3 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
    int W,H;
    char C,table[55];
    cin >> W >> H >> C;
    for(int x=0;x<=W;x+=2){
        if(C=='B'){
            table[x]='B';
            table[x+1]='W';
        }
        else{
            table[x]='W';
            table[x+1]='B';
        }
    }    
    for(int y=1;y<=H;y++){
        if(y%2){
            for(int x=2;x<=W+1;x++){
                cout << table[x];
            }
        }
        else{
            for(int x=1;x<=W;x++){
                cout << table[x];
            }
        }
        cout << endl;
    }
    return 0;
}

0