結果

問題 No.920 あかあお
ユーザー SKSK
提出日時 2022-12-20 16:57:26
言語 PHP
(8.3.4)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 368 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 32,144 KB
実行使用メモリ 31,404 KB
最終ジャッジ日時 2024-04-29 02:51:54
合計ジャッジ時間 1,262 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
30,896 KB
testcase_01 AC 42 ms
30,828 KB
testcase_02 AC 44 ms
30,988 KB
testcase_03 AC 42 ms
31,376 KB
testcase_04 AC 41 ms
31,108 KB
testcase_05 AC 40 ms
31,212 KB
testcase_06 AC 39 ms
31,320 KB
testcase_07 AC 40 ms
31,056 KB
testcase_08 AC 40 ms
31,096 KB
testcase_09 AC 40 ms
31,076 KB
testcase_10 AC 41 ms
30,936 KB
testcase_11 AC 40 ms
31,152 KB
testcase_12 AC 39 ms
30,892 KB
testcase_13 AC 40 ms
31,404 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