結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2015-07-26 17:17:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 515 bytes |
コンパイル時間 | 1,275 ms |
コンパイル使用メモリ | 158,300 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 14:08:25 |
合計ジャッジ時間 | 1,822 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++)#define rep(i,n) repi(i,0,n)int w, h;char c[2];void solve() {if(c[0] == 'W') c[1] = 'B';else c[1] = 'W';rep(i,h) {rep(j,w) cout << c[j%2];cout << endl;swap(c[0], c[1]);}}void input() {cin >> w >> h >> c[0];}int main() {cin.tie(0);ios_base::sync_with_stdio(0);cout << fixed << setprecision(12);input();solve();return 0;}