結果
| 問題 |
No.82 市松模様
|
| コンテスト | |
| ユーザー |
srup٩(๑`н´๑)۶
|
| 提出日時 | 2016-08-25 15:34:19 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 556 bytes |
| コンパイル時間 | 463 ms |
| コンパイル使用メモリ | 61,264 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-08 02:17:40 |
| 合計ジャッジ時間 | 970 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(void){
int w, h; cin >> w >> h;
string c; cin >> c;
int cnt;
if(c == "B") cnt = 0;
else cnt = 1;
rep(i, h){
string tmp;
if(cnt % 2 == 0){
int f = 0;
rep(j, w){
if(f % 2 == 0) tmp += 'B';
else tmp += 'W';
f++;
}
}else{
int f = 1;
rep(j, w){
if(f % 2 == 0) tmp += 'B';
else tmp += 'W';
f++;
}
}
cout << tmp << endl;
cnt++;
}
}
srup٩(๑`н´๑)۶