結果

問題 No.82 市松模様
ユーザー scrive66
提出日時 2015-06-03 19:19:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 555 bytes
コンパイル時間 711 ms
コンパイル使用メモリ 64,652 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 13:57:40
合計ジャッジ時間 1,517 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
using namespace std;
# define M_PI 3.14159265358979323846

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    ostringstream sout;
    
    string ichimatsu = "WBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBW";
    
    int w, h;
    char c;
    
    cin >> w >> h >> c;
    bool isb = (c == 'B');
    
    for(int i = 0; i < h; i++){
    	sout << ichimatsu.substr((int)isb, w) << endl;
    	isb = !isb;
    }
    cout << sout.str();
    
    return 0;
}
0