結果
問題 | No.82 市松模様 |
ユーザー |
|
提出日時 | 2021-05-23 21:47:16 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 537 bytes |
コンパイル時間 | 1,994 ms |
コンパイル使用メモリ | 165,348 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-12 02:30:27 |
合計ジャッジ時間 | 2,564 ms |
ジャッジサーバーID (参考情報) |
judge3 / 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;vector<string> ans={};int c;if (C=='B'){c = 0;}else{c = 1;}for (int i=0;i<H;i++){string st="";for (int j=0;j<W;j++){if ((i+j) % 2 == c){st += 'B';}else{st += 'W';}}ans.push_back(st);}for (int i=0;i<H;i++){cout<<ans[i]<<endl;}}