結果

問題 No.21 平均の差
ユーザー focus
提出日時 2018-02-03 00:35:31
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 299 bytes
コンパイル時間 668 ms
コンパイル使用メモリ 68,680 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-31 08:21:17
合計ジャッジ時間 1,239 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    int N,K,x;
    vector<int> n;
    cin >> N >> K;
    while(N--){
        cin >> x;
        n.push_back(x);
    }
    sort(n.begin(),n.end());
    cout << n[n.size()-1]-n[0];
    return 0;
}
0