結果
問題 | No.82 市松模様 |
ユーザー |
|
提出日時 | 2015-02-22 15:40:26 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 363 bytes |
コンパイル時間 | 459 ms |
コンパイル使用メモリ | 59,244 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 21:50:00 |
合計ジャッジ時間 | 974 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include <iostream>#include <cstdio>#include <vector>#include <algorithm>#include <utility>using namespace std;int main() {int w, h;char c;char mark[2] = {'B', 'B'};cin >> w >> h >> c;mark[c == 'B' ? 1 : 0] = 'W';for (int i = 0; i < h; i++) {for (int j = 0; j < w; j++) {cout << mark[(i + j) % 2];}cout << endl;}return 0;}