結果
| 問題 | No.82 市松模様 |
| コンテスト | |
| ユーザー |
srup٩(๑`н´๑)۶
|
| 提出日時 | 2016-08-25 15:34:19 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 284µs | |
| コード長 | 556 bytes |
| 記録 | |
| コンパイル時間 | 318 ms |
| コンパイル使用メモリ | 85,608 KB |
| 実行使用メモリ | 9,932 KB |
| 最終ジャッジ日時 | 2026-09-21 00:57:27 |
| 合計ジャッジ時間 | 1,499 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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٩(๑`н´๑)۶