結果

問題 No.21 平均の差
ユーザー kya_skikya_ski
提出日時 2020-04-12 11:49:07
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 335 bytes
コンパイル時間 1,693 ms
コンパイル使用メモリ 167,696 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-22 02:18:16
合計ジャッジ時間 2,319 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int &e : a) cin >> e;
    
    int ans = *max_element(a.begin(), a.end()) - *min_element(a.begin(), a.end());
    
    cout << ans << '\n';
    return 0;
}
0