結果
問題 |
No.82 市松模様
|
ユーザー |
|
提出日時 | 2019-10-19 13:41:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 576 bytes |
コンパイル時間 | 627 ms |
コンパイル使用メモリ | 70,136 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-27 02:35:44 |
合計ジャッジ時間 | 1,257 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 1 WA * 6 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef long long int ll; char fi[100][100]; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int h,w; cin >> h >> w; char s; cin >> s; if(s=='B'){ for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ if((i+j)%2==0)fi[i][j]='B'; else fi[i][j]='W'; } } } else{ for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ if((i+j)%2==1)fi[i][j]='B'; else fi[i][j]='W'; } } } for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cout << fi[i][j]; } cout << endl; } }