結果
問題 | No.82 市松模様 |
ユーザー |
|
提出日時 | 2014-12-02 23:34:22 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 577 bytes |
コンパイル時間 | 685 ms |
コンパイル使用メモリ | 72,800 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-11 07:44:23 |
合計ジャッジ時間 | 1,268 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include <algorithm>#include <cmath>#include <cstdio>#include <cstdlib>#include <cstring>#include <iostream>#include <map>#include <queue>#include <set>#include <string>#include <vector>using namespace std;typedef pair<int, int> pii;#define rep(i,x) for(int i=0;i<(int)(x);i++)int main(){bool bf = false, tmp = false;int w, h;char c;cin >> w >> h >> c;if (c=='B') bf = true;rep(i,h) {tmp = bf;rep(j,w) {if (tmp) cout << "B";else cout << "W";tmp = !tmp;}bf = !bf;cout << endl;}return 0;}