結果
問題 | No.82 市松模様 |
ユーザー |
|
提出日時 | 2018-08-04 19:20:47 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 401 bytes |
コンパイル時間 | 199 ms |
コンパイル使用メモリ | 28,928 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-19 17:54:02 |
合計ジャッジ時間 | 868 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include <stdio.h>int main(void){int W, H;char C;int x, y;char a[2] = { 'B', 'W' };int b, c;scanf("%d %d %c", &W, &H, &C);b = ((C == 'B') ? 0 : 1);for (y = 0; y < H; y++) {c = b ^ (y & 1);for (x = 0; x < W; x++) {putchar(a[c]);c ^= 1;}putchar('\n');}return 0;}