結果

問題 No.21 平均の差
ユーザー streingmuststreingmust
提出日時 2020-02-20 22:32:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 283 bytes
コンパイル時間 817 ms
コンパイル使用メモリ 66,868 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-08 19:19:24
合計ジャッジ時間 1,462 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>

int main(void){
    int N,K;
    std::cin >> N >> K;
    int* n = new int[N];
    for(int i=0;i<N;i++){
        std::cin >> n[i];
    }
    std::cout << *(std::max_element(n, n+N)) - *(std::min_element(n, n+N)) << std::endl;
    return 0;
}
0