結果

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

ソースコード

diff #

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

int main()
{
int i;
int N;
int K;
int n;
int iMax;
int iMin;

	cin >> N;
	cin >> K;

	iMax = 0;
	iMin = 1000;
	for( i = 0; i < N; i++ )
	{
		cin >> n;
		if( iMax < n ) iMax = n;
		if( iMin > n ) iMin = n;
	}

	cout << iMax - iMin << endl;

	return 0;
}
0