結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2014-12-12 08:44:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 251 bytes |
コンパイル時間 | 228 ms |
コンパイル使用メモリ | 22,912 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-11 20:55:28 |
合計ジャッジ時間 | 708 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf( "%d%d%s", &W, &H, C ); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<cstdio>#define rep(i,a) for(int i=0;i<(a);++i)int main(){int W, H;char C[2];scanf( "%d%d%s", &W, &H, C );rep( i, H ){rep( j, W )putchar( (i+j)&1?(*C=='B'?'W':'B'):*C );puts("");}return 0;}