結果

問題 No.21 平均の差
ユーザー sewoiwataki
提出日時 2018-02-19 23:22:52
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 305 bytes
コンパイル時間 354 ms
コンパイル使用メモリ 53,712 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-16 03:53:07
合計ジャッジ時間 916 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>

#define DEBUG

using namespace std;

int main(){
    int N;
    int K;
    int max,min;
    int n;

    cin>>N;
    cin>>K;

    cin>>n;
    max=n;
    min=n;
    for(int i=1;i<N;i++){
        cin>>n;
        if(max<n) max=n;
        if(min>n) min=n;
    }

    cout<<max-min<<endl;
}
0