結果

問題 No.21 平均の差
ユーザー Yut176Yut176
提出日時 2016-06-07 00:09:12
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 369 bytes
コンパイル時間 787 ms
コンパイル使用メモリ 67,056 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-08 16:52:19
合計ジャッジ時間 1,455 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<stdlib.h>
#include<vector>
#include<string>
#include<sstream>
using namespace std;


int main(){

  int n,k;
  cin >> n;
  cin >> k;
  vector<int> v;
  for(int i=0;i<n;i++){
    int tmp;
    cin >> tmp;
    v.push_back(tmp);
  }
  sort(v.begin(),v.end());

  cout << v[n-1]-v[0] << endl;

  return 0;
}
0