結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2014-12-02 23:23:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 766 bytes |
コンパイル時間 | 561 ms |
コンパイル使用メモリ | 82,872 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-11 07:40:57 |
合計ジャッジ時間 | 1,031 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include <algorithm>#include <climits>#include <cstdlib>#include <vector>#include <cctype>#include <deque>#include <cmath>#include <queue>#include <map>#include <set>#include <ctime>#include <stack>#include <cstdio>#include <string>#include <iomanip>#include <cstring>#include <iostream>#include <functional>using namespace std;typedef long long ll;#define LLMAX LLONG_MAX#define IMAX INT_MAXint main() {int w, h; char c;cin >> w >> h >> c;char p[] = {'B', 'W'};if (c == 'W') swap(p[0], p[1]);for (int i = 0; i < h; i++) {for (int j = 0; j < w; j++) {if ((i+j)%2 == 0) {cout << p[0];}else {cout << p[1];}}cout << endl;}}