結果
問題 | No.82 市松模様 |
ユーザー |
|
提出日時 | 2024-10-05 11:43:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 678 bytes |
コンパイル時間 | 627 ms |
コンパイル使用メモリ | 80,724 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-05 11:43:18 |
合計ジャッジ時間 | 1,161 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include <iostream>#include <math.h>#include <algorithm>#include <map>#include <vector>#include <numeric>using namespace std;#define rep(i, n) for (int i = 0; i < (int)(n); i++)#define rep2(i, d, n) for (int i = d; i < (int)(n); i++)#define rRep(i,n) for(int i = n; i >= 0; i--)#define rRep2(i,d,n) for(int i = n; i >= d; i--)#define forEach(arr) for (auto& it:arr)int main(void){int w,h;char c;cin >> w >> h >> c;string s ="",t ="";rep(i,w) {s = s + c;c = c == 'B' ? 'W':'B';t = t + c;}rep(i,h) {if(i % 2 == 0) cout << s << endl;else cout << t << endl;}}