結果

問題 No.394 ハーフパイプ(1)
ユーザー koyumeishikoyumeishi
提出日時 2015-10-27 23:29:43
言語 C++11
(gcc 11.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 381 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 55,160 KB
最終ジャッジ日時 2024-04-22 16:24:23
合計ジャッジ時間 821 ms
ジャッジサーバーID
(参考情報)
judge5 / 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());
	ans *= 25;
	printf("%d.%02d\n", ans/100, ans%100);
}
0