結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー Kentaro YanoKentaro Yano
提出日時 2021-03-29 17:05:13
言語 PHP
(8.3.4)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 196 bytes
コンパイル時間 1,003 ms
コンパイル使用メモリ 18,428 KB
実行使用メモリ 39,168 KB
最終ジャッジ日時 2023-08-19 16:17:40
合計ジャッジ時間 2,049 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
18,916 KB
testcase_01 AC 13 ms
18,716 KB
testcase_02 AC 14 ms
18,844 KB
testcase_03 AC 13 ms
18,672 KB
testcase_04 AC 14 ms
18,856 KB
testcase_05 AC 14 ms
18,892 KB
testcase_06 AC 14 ms
18,836 KB
testcase_07 AC 16 ms
18,868 KB
testcase_08 AC 21 ms
22,956 KB
testcase_09 AC 27 ms
26,984 KB
testcase_10 AC 58 ms
39,104 KB
testcase_11 AC 59 ms
39,168 KB
testcase_12 AC 65 ms
39,144 KB
testcase_13 AC 60 ms
39,076 KB
testcase_14 AC 62 ms
39,076 KB
testcase_15 AC 63 ms
38,936 KB
testcase_16 AC 67 ms
39,156 KB
testcase_17 AC 13 ms
18,852 KB
testcase_18 AC 14 ms
18,900 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

while($line = trim(fgets(STDIN))){
    $tmp[] = $line;
}

foreach($tmp as $val){
 $arr = explode(" ", $val);
}

$sum = 0;
for($i=0; $i<$tmp[0]; $i++){
    $sum += $arr[$i];
}
echo $sum;

?>
0