結果
| 問題 | No.21 平均の差 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-01-22 22:55:34 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| + 306µs | |
| コード長 | 352 bytes |
| 記録 | |
| コンパイル時間 | 304 ms |
| コンパイル使用メモリ | 76,256 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-27 11:56:29 |
| 合計ジャッジ時間 | 1,327 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
int maxi = 0;
int mini = 1e9;
int input;
for (int i = 0; i < n; i++) {
cin >> input;
maxi = max(maxi, input);
mini = min(mini, input);
}
cout << maxi - mini << endl;
return 0;
}