結果
問題 |
No.82 市松模様
|
ユーザー |
![]() |
提出日時 | 2017-08-09 13:58:14 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 664 bytes |
コンパイル時間 | 542 ms |
コンパイル使用メモリ | 64,344 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 03:53:44 |
合計ジャッジ時間 | 1,094 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 1 WA * 6 |
ソースコード
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int w,h; string c; cin >> w >> h >> c; //w,h vector生成 vector< vector<string> > arr; arr.resize(w); for (int i = 0; i < w; i++) { arr[i].resize(h); } //arrにBW入力、出力 string s; if (c == "B") { s = "W" ;} if (c == "W") { s = "B" ;} for (int i = 0; i < w; i++) { for (int j = 0; j < h; j++) { if ((i + j) % 2 == 0) { arr[i][j] = c; }else { arr[i][j] = s; } if (j == h - 1) { cout << arr[i][j] << "\n"; }else{ cout << arr[i][j]; } } } return 0; }