結果

問題 No.920 あかあお
ユーザー SKSK
提出日時 2022-12-20 16:56:36
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 364 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 31,112 KB
実行使用メモリ 31,720 KB
最終ジャッジ日時 2024-04-29 02:51:52
合計ジャッジ時間 1,258 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
31,016 KB
testcase_01 AC 40 ms
31,160 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 39 ms
30,864 KB
testcase_06 AC 40 ms
30,968 KB
testcase_07 WA -
testcase_08 AC 41 ms
31,168 KB
testcase_09 WA -
testcase_10 AC 40 ms
30,896 KB
testcase_11 AC 41 ms
31,188 KB
testcase_12 AC 40 ms
31,272 KB
testcase_13 AC 40 ms
30,824 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

[$x,$y,$z] = explode(" ",trim(fgets(STDIN)));
$ans = 0;

if ($x >= $y && ($x - $y) >= $z) {
    $ans += $y;
    $ans += $z;
}elseif ($x < $y && ($y - $x) >= $z) {
    $ans += $x;
    $ans += $z;
}elseif ($x >= $y && ($x - $y) < $z) {
    $ans += $y;
    $ans += floor($x -$y + $z)/2;
}else {
    $ans += $x;
    $ans += floor($y - $x + $z)/2;
}


echo $ans;
0