結果
| 問題 |
No.82 市松模様
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-01 18:49:50 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 462 bytes |
| コンパイル時間 | 906 ms |
| コンパイル使用メモリ | 75,044 KB |
| 最終ジャッジ日時 | 2025-02-20 18:59:01 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n, m;
char s;
cin >> n >> m >> s;
vector<vector<char>> l(m, vector<char>(n, ' '));
for(int i = 0; i < m; i++){
for(int j = 0; j < n; j++){
if ((i + j) % 2 == 0) {
l[i][j] = s;
} else {
l[i][j] = (s == 'B') ? 'W' : 'B';
}
cout << l[i][j];
}
cout << endl;
}
}