結果

問題 No.1046 Fruits Rush
ユーザー SKSK
提出日時 2022-12-20 15:46:14
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 208 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 30,860 KB
実行使用メモリ 31,252 KB
最終ジャッジ日時 2024-04-29 02:49:48
合計ジャッジ時間 1,352 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
30,864 KB
testcase_01 AC 38 ms
31,064 KB
testcase_02 AC 36 ms
31,112 KB
testcase_03 AC 35 ms
31,208 KB
testcase_04 AC 35 ms
31,080 KB
testcase_05 AC 36 ms
31,204 KB
testcase_06 AC 36 ms
30,768 KB
testcase_07 AC 38 ms
30,976 KB
testcase_08 AC 38 ms
31,196 KB
testcase_09 AC 37 ms
30,944 KB
testcase_10 AC 35 ms
31,200 KB
testcase_11 AC 35 ms
30,764 KB
testcase_12 AC 35 ms
31,056 KB
testcase_13 AC 35 ms
30,996 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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){
        $count += $a[$i];
    }
}

echo $count;
?>
0