結果
| 問題 |
No.21 平均の差
|
| ユーザー |
👑 |
| 提出日時 | 2022-08-08 09:37:13 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 5,000 ms |
| コード長 | 484 bytes |
| コンパイル時間 | 724 ms |
| コンパイル使用メモリ | 70,536 KB |
| 最終ジャッジ日時 | 2025-01-30 19:24:33 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <stdio.h>
#include <stdint.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
int main()
{
ll N;
ll K;
cin >> N;
cin >> K;
ll n;
ll n_min = 1001;
ll n_max = 0;
for( ll i = 0 ; i < N ; i++ ){
cin >> n;
if( n < n_min ){
n_min = n;
}
if( n_max < n ){
n_max = n;
}
}
cout << n_max - n_min << endl;;
return 0;
}