結果
| 問題 |
No.88 次はどっちだ
|
| コンテスト | |
| ユーザー |
y2k
|
| 提出日時 | 2015-12-11 20:16:30 |
| 言語 | PHP (843.2) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 5,000 ms |
| コード長 | 932 bytes |
| コンパイル時間 | 1,316 ms |
| コンパイル使用メモリ | 30,936 KB |
| 実行使用メモリ | 31,140 KB |
| 最終ジャッジ日時 | 2024-09-15 08:23:47 |
| 合計ジャッジ時間 | 2,054 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php
fscanf(STDIN, "%s", $input1);
fscanf(STDIN, "%s", $input2);
fscanf(STDIN, "%s", $input3);
fscanf(STDIN, "%s", $input4);
fscanf(STDIN, "%s", $input5);
fscanf(STDIN, "%s", $input6);
fscanf(STDIN, "%s", $input7);
fscanf(STDIN, "%s", $input8);
fscanf(STDIN, "%s", $input9);
// $input1 = 'oda';
// $input2 = '........';
// $input3 = '........';
// $input4 = '........';
// $input5 = '...wb...';
// $input6 = '...bw...';
// $input7 = '........';
// $input8 = '........';
// $input9 = '........';
$s = $input2.$input3.$input4.$input5.$input6.$input7.$input8.$input9;
$s_after = str_split($s);
$s_ret = array_count_values($s_after);
// .
$cnt_1 = $s_ret['.'];
// w
$cnt_w = $s_ret['w'];
// b
$cnt_b = $s_ret['b'];
$cnt = $cnt_w + $cnt_b;
$p1 = 'oda';
$p2 = 'yukiko';
if ($cnt % 2 == 0) {
$ret = $input1;
} else {
if ($p1 == $input1) {
$ret = $p2;
} else {
$ret = $p1;
}
}
echo $ret;
echo "\n";
y2k