結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2017-10-20 22:40:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 873 bytes |
コンパイル時間 | 698 ms |
コンパイル使用メモリ | 77,968 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-21 10:51:37 |
合計ジャッジ時間 | 1,113 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include<iostream>#include<string>#include<string.h>#include<algorithm>#include<stdio.h>#include<cmath>#include<vector>#include<utility>#include<stack>#include<queue>#include<list>#include<bitset>#define FOR(i, a, b) for(int i=(a);i<=(b);i++)#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)#define MOD 1000000007#define INF 1000000000using namespace std;int main(void) {bool flag;int w, h;char c;cin >> w >> h >> c;if (c == 'B') {flag = true;}else {flag = false;}FOR(i, 1, h) {if (flag == true) {FOR(t, 1, w) {if (t % 2 == 1) {cout << "B";}else {cout << "W";}}}else {FOR(t, 1, w) {if (t % 2 == 1) {cout << "W";}else {cout << "B";}}}cout << endl;if (flag == true) {flag = false;}else {flag = true;}}return 0;}