結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2022-04-27 21:33:07 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 343 bytes |
コンパイル時間 | 803 ms |
コンパイル使用メモリ | 66,152 KB |
最終ジャッジ日時 | 2025-01-28 22:04:37 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include <iostream> using namespace std; int main() { int W, H; char C; cin >> W >> H >> C; char notC; notC =( C == 'B' ? 'W' : 'B' ); for( int y = 0; y < H; y++ ) { for( int x = 0; x < W; x++ ) { //cout << ( ( x + y )%2 ) << " c " << endl; cout << ( ( ( x + y )%2 == 0 ) ? C : notC ); } cout << endl; } return 0; }