結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2016-10-22 23:48:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 378 bytes |
コンパイル時間 | 510 ms |
コンパイル使用メモリ | 63,276 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-23 17:46:35 |
合計ジャッジ時間 | 1,167 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include<iostream>#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);++i)using namespace std;int main(){int W, H;char C;cin >> W >> H >> C;char ls[2] = {'W', 'B'};int pos = (C == 'W' ? 0 : 1);REP(i, 0, H) {REP(j, 0, W) {if ((i + j) % 2) {cout << ls[1 - pos];} else {cout << ls[pos];}}cout << '\n';}return 0;}