結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2018-10-21 22:49:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 512 bytes |
コンパイル時間 | 1,647 ms |
コンパイル使用メモリ | 166,660 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-19 03:33:28 |
合計ジャッジ時間 | 2,415 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include"bits/stdc++.h"using namespace std;int main() {int W, H;cin >> W >> H;char C;cin >> C;char c[2];if (C == 'B') {c[0] = 'B';c[1] = 'W';}else {c[0] = 'W';c[1] = 'B';}int n=0;for (int i = 0; i < H; i++) {for (int j = 0; j < W; j++) {if (i % 2 == 0) {if (j % 2 == 0) {cout << c[0];}else {cout << c[1];}}else {if (j % 2 == 0) {cout << c[1];}else {cout << c[0];}}}cout << endl;}}