結果

問題 No.394 ハーフパイプ(1)
ユーザー airisairis
提出日時 2017-01-08 20:51:07
言語 Bash
(Bash 5.1.16)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-25 20:29:51
合計ジャッジ時間 844 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,380 KB
testcase_01 AC 6 ms
4,380 KB
testcase_02 AC 5 ms
4,376 KB
testcase_03 AC 6 ms
4,384 KB
testcase_04 AC 6 ms
4,380 KB
testcase_05 AC 5 ms
4,380 KB
testcase_06 AC 5 ms
4,380 KB
testcase_07 AC 5 ms
4,380 KB
testcase_08 AC 5 ms
4,376 KB
testcase_09 AC 5 ms
4,376 KB
testcase_10 AC 5 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/bin/bash

read s

sum=0
maxi=-1
mini=1000
for x in $s; do
	sum=$((sum + x))
	if [ $x -gt $maxi ]; then
		maxi=$x
	fi
	if [ $x -lt $mini ]; then
		mini=$x
	fi
done
sum=$((sum-maxi-mini))

ave=`echo $sum | awk '{printf("%.2f", $1/4.0);}'`
echo $ave
0