結果

問題 No.21 平均の差
ユーザー siguma323siguma323
提出日時 2016-05-08 16:08:14
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 654 bytes
コンパイル時間 735 ms
コンパイル使用メモリ 87,728 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 13:52:04
合計ジャッジ時間 1,342 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <list>
#include <map>
#include <queue>
#include <iterator>
#include <cmath>
#include <iomanip>
using namespace std;

using ull = unsigned long long;
using ll = long long;

int main()
{
    int n,k;
    cin >> n >> k;
    vector<int> nums(n);
    for(auto&& x : nums)    cin >> x;

    sort(nums.begin(),nums.end());

    double min_avr = nums.at(0);
    double max_avr = nums.at(nums.size()-1);

    cout << min_avr << ' ' << max_avr << endl;

    cout << ceil(max_avr - min_avr) << endl;

}
0