結果
問題 | No.21 平均の差 |
ユーザー |
|
提出日時 | 2023-02-20 09:53:04 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 347 bytes |
コンパイル時間 | 631 ms |
コンパイル使用メモリ | 75,664 KB |
最終ジャッジ日時 | 2025-02-10 19:12:44 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> int main() { int N, K; std::cin >> N; std::cin >> K; std::vector<int> V(N); for (int i = 0; i < N; i++) { std::cin >> V.at(i); } int max = *max_element(V.begin(), V.end()); int min = *min_element(V.begin(), V.end()); std::cout << max - min << std::endl; }