結果
| 問題 | No.82 市松模様 |
| コンテスト | |
| ユーザー |
funakoshi
|
| 提出日時 | 2019-08-08 16:57:46 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 1,728 bytes |
| 記録 | |
| コンパイル時間 | 272 ms |
| コンパイル使用メモリ | 38,092 KB |
| 最終ジャッジ日時 | 2026-02-22 04:11:37 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
int width,height;
char color;
scanf("%d %d %c",&width,&height,&color);
if(color=='B')
{
for(int i=0;i<height;i++)
{
for(int j=0;j<width;j++)
{
if(i%2==0)
{
if(j%2==0)
{
printf("B");
}
else
{
printf("W");
}
}
else if(i%2!=0)
{
if(j%2==0)
{
printf("W");
}
else
{
printf("B");
}
}
}
printf("\n");
}
}
else
{
for(int i=0;i<height;i++)
{
for(int j=0;j<width;j++)
{
if(i%2==0)
{
if(j%2==0)
{
printf("W");
}
else
{
printf("B");
}
}
else if(i%2!=0)
{
if(j%2==0)
{
printf("B");
}
else
{
printf("W");
}
}
}
printf("\n");
}
}
}
funakoshi