結果
問題 | No.21 平均の差 |
ユーザー | hotpepsi |
提出日時 | 2015-03-19 10:19:14 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 444 bytes |
コンパイル時間 | 506 ms |
コンパイル使用メモリ | 68,660 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-11 08:34:17 |
合計ジャッジ時間 | 1,412 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,380 KB |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 1 ms
4,380 KB |
testcase_04 | AC | 2 ms
4,380 KB |
testcase_05 | AC | 2 ms
4,376 KB |
testcase_06 | AC | 2 ms
4,380 KB |
testcase_07 | AC | 1 ms
4,380 KB |
testcase_08 | AC | 1 ms
4,376 KB |
testcase_09 | AC | 1 ms
4,376 KB |
ソースコード
#include <iostream> #include <algorithm> #include <sstream> #include <vector> using namespace std; int main(int argc, char *argv[]) { string s; getline(cin, s); int N = atoi(s.c_str()); getline(cin, s); int K = atoi(s.c_str()); vector<int> A(N); for (int i = 0; i < N; ++i) { getline(cin, s); A[i] = atoi(s.c_str()); } sort(A.begin(), A.end()); int ans = A.back() - A.front(); cout << ans << endl; return 0; }