結果

問題 No.394 ハーフパイプ(1)
ユーザー N/AN/A
提出日時 2018-09-03 01:29:39
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 515 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 30,848 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 02:45:29
合計ジャッジ時間 655 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main(void) {
	double s[6], sum = 0, max = 0, min = 100;
	int or , sr;

	for (int i = 0; i < 6; i++)
		scanf("%lf", &s[i]);

	for (int j = 0; j < 6; j++) {
		if (max <= s[j]) {
			max = s[j];
			or = j;
		}
		if (min >= s[j]) {
			min = s[j];
			sr = j;
		}
	}

	if (or == sr)
		printf("%.2lf\n", max);
	else {
		s[or ] = -1;
		s[sr] = -1;

		for (int k = 0; k < 6; k++) {
			if (s[k] >= 0)
				sum += s[k];
		}
		printf("%.2lf\n", sum / 4.0);
	}

	return 0;
}
0