結果
| 問題 |
No.82 市松模様
|
| コンテスト | |
| ユーザー |
mondo
|
| 提出日時 | 2019-07-30 14:10:55 |
| 言語 | PHP (843.2) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 5,000 ms |
| コード長 | 342 bytes |
| コンパイル時間 | 1,809 ms |
| コンパイル使用メモリ | 30,768 KB |
| 実行使用メモリ | 31,156 KB |
| 最終ジャッジ日時 | 2024-07-04 15:16:21 |
| 合計ジャッジ時間 | 2,471 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php
list($w,$h,$c) = explode(" ", trim(fgets(STDIN)));
$color = array('B', 'W');
$index = 1;
if($c == 'W') {
$index = 0;
}
for($i = 0; $i < $h; $i++) {
$str = "";
$index = 1 - $index;
for($j = 0; $j < $w; $j++) {
if($j % 2 == 0) {
$str .= $color[$index];
} else {
$str .= $color[1 - $index];
}
}
echo($str);
echo("\n");
}
mondo