結果
問題 |
No.21 平均の差
|
ユーザー |
![]() |
提出日時 | 2015-08-25 16:45:44 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 275 bytes |
コンパイル時間 | 384 ms |
コンパイル使用メモリ | 56,280 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 13:22:23 |
合計ジャッジ時間 | 845 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream> #include <algorithm> int main(){ int n, k; std::cin >> n >> k; int max = -1, min = 10000; for (int i = 0; i < n; ++i){ int a; std::cin >> a; max = std::max(max, a); min = std::min(min, a); } std::cout << max - min << std::endl; return 0; }