結果
| 問題 |
No.82 市松模様
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-28 04:40:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 450 bytes |
| コンパイル時間 | 779 ms |
| コンパイル使用メモリ | 73,596 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-10 04:43:32 |
| 合計ジャッジ時間 | 1,197 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 1 WA * 6 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int h,w;
cin >> h >> w;
char c;
cin >> c;
vector<vector<bool>> b(h, vector<bool>(w));
b[0][0] = ((c == 'B')?true:false);
for(int i = 1; i < h; i++){
b[i][0]=not b[i-1][0];
}
for(int i = 1; i < h; i++){
for(int j = 1; j < w; j++){
b[i][j] = not b[i][j-1];
}
}
for(int i = 0; i < h; i++){
for(int j = 0; j < w; j++){
cout << (b[i][j]?'B':'W');
}
cout << endl;
}
return 0;
}