結果

問題 No.82 市松模様
ユーザー ayaaya
提出日時 2019-07-30 12:40:47
言語 PHP
(8.3.4)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 413 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 18,588 KB
実行使用メモリ 18,832 KB
最終ジャッジ日時 2023-09-17 06:14:00
合計ジャッジ時間 1,154 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,524 KB
testcase_01 AC 16 ms
18,804 KB
testcase_02 AC 16 ms
18,704 KB
testcase_03 AC 16 ms
18,784 KB
testcase_04 AC 15 ms
18,764 KB
testcase_05 AC 15 ms
18,524 KB
testcase_06 AC 16 ms
18,832 KB
testcase_07 AC 16 ms
18,788 KB
testcase_08 AC 19 ms
18,736 KB
testcase_09 AC 19 ms
18,728 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$input=explode(" ",trim(fgets(STDIN)));
$width=$input[0];
$height=$input[1];
$color=$input[2];
$uncoler;
if($color[0]=="B"){
  $uncolor="W";
}else{
  $uncolor="B";
}
$pattern;
for($y=0;$y<$height;$y++){
  for($x=0;$x<$width;$x++){
    if(($x+$y)%2!=0){
    $pattern=$uncolor;
    echo $pattern;
    }else{
      $pattern=$color;
      echo $pattern;
    }
    if ($x==$width-1){
    echo "\n";
    }
  }

}
0