結果

問題 No.582 キャンディー・ボックス3
ユーザー papinianuspapinianus
提出日時 2017-11-14 16:47:20
言語 PHP
(8.2.11)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 12,040 KB
実行使用メモリ 12,268 KB
最終ジャッジ日時 2023-08-16 13:06:41
合計ジャッジ時間 1,200 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
12,220 KB
testcase_01 AC 7 ms
12,184 KB
testcase_02 AC 7 ms
12,268 KB
testcase_03 AC 8 ms
12,212 KB
testcase_04 AC 8 ms
12,224 KB
testcase_05 AC 7 ms
12,168 KB
testcase_06 AC 6 ms
12,224 KB
testcase_07 AC 7 ms
12,268 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 7 ms
12,228 KB
testcase_11 AC 7 ms
12,260 KB
testcase_12 AC 7 ms
12,164 KB
testcase_13 AC 7 ms
12,212 KB
testcase_14 AC 7 ms
12,224 KB
testcase_15 AC 7 ms
12,236 KB
testcase_16 WA -
testcase_17 AC 7 ms
12,196 KB
testcase_18 AC 7 ms
12,268 KB
testcase_19 AC 7 ms
12,240 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$n = trim(fgets(STDIN));
$boxes = array_count_values(explode(" ", trim(fgets(STDIN))));

if($n % 2 === 1) {
    $aVincible = isset($boxes[1]) && (count($boxes) === 1) ;
} else {
    $aVincible = isset($boxes[1]) && isset($boxes["2"]) &&  (count($boxes) === 2)  && $boxes["2"] === 1;
}

echo $aVincible ? "A" : "B";
echo PHP_EOL;
0