結果

問題 No.394 ハーフパイプ(1)
ユーザー koyumeishikoyumeishi
提出日時 2015-10-27 23:30:37
言語 C++11
(gcc 11.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 357 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 56,072 KB
最終ジャッジ日時 2024-04-27 02:13:45
合計ジャッジ時間 571 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:19: error: ‘accumulate’ was not declared in this scope
   12 |         int ans = accumulate(s.begin(), s.end(), 0) - *min_element(s.begin(), s.end()) - *max_element(s.begin(), s.end());
      |                   ^~~~~~~~~~
main.cpp:9:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |                 scanf("%d", &s[i]);
      |                 ~~~~~^~~~~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
using namespace std;
int main(){
	vector<int> s(6);
	for(int i=0; i<6; i++){
		scanf("%d", &s[i]);
		assert(0<=s[i] && s[i]<=100);
	}
	int ans = accumulate(s.begin(), s.end(), 0) - *min_element(s.begin(), s.end()) - *max_element(s.begin(), s.end());
	printf("%.2f\n", ans/4.0);
}
0