結果

問題 No.82 市松模様
ユーザー papinianuspapinianus
提出日時 2016-06-07 15:35:33
言語 PHP
(8.3.4)
結果
AC  
実行時間 41 ms / 5,000 ms
コード長 327 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 32,404 KB
実行使用メモリ 32,656 KB
最終ジャッジ日時 2024-04-17 05:40:55
合計ジャッジ時間 1,019 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
32,400 KB
testcase_01 AC 40 ms
32,400 KB
testcase_02 AC 38 ms
32,400 KB
testcase_03 AC 41 ms
32,216 KB
testcase_04 AC 39 ms
32,400 KB
testcase_05 AC 39 ms
32,656 KB
testcase_06 AC 39 ms
32,340 KB
testcase_07 AC 40 ms
32,340 KB
testcase_08 AC 39 ms
32,404 KB
testcase_09 AC 39 ms
32,400 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$stem = "WBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWB";
list($wid, $hei, $col) = explode(' ', trim(fgets(STDIN)));
if($col == 'W') {
    $pos = 0;
} else {
    $pos = 1;
}
$line[1] = substr($stem, $pos, $wid);
$line[0] = substr($stem, $pos+1, $wid);
for($i = 1; $i <= $hei; $i++) {
    echo $line[$i%2].PHP_EOL;
}
0