結果

問題 No.1046 Fruits Rush
ユーザー SKSK
提出日時 2022-12-20 15:47:53
言語 PHP
(8.3.4)
結果
TLE  
実行時間 -
コード長 216 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 31,124 KB
実行使用メモリ 36,396 KB
最終ジャッジ日時 2024-04-29 02:49:52
合計ジャッジ時間 3,573 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
36,396 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
[$n,$k] = explode(" ",trim(fgets(STDIN)));
$count = 0;
$a = explode(" ",trim(fgets(STDIN)));

rsort($a);

for($i = 0;$k > $i;$i++){
    if($a[$i] > 0 || $i=0){
        $count += $a[$i];
    }
}

echo $count;
?>
0