結果
| 問題 |
No.21 平均の差
|
| ユーザー |
dgd1724
|
| 提出日時 | 2016-09-08 18:12:19 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 496 bytes |
| コンパイル時間 | 814 ms |
| コンパイル使用メモリ | 66,244 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-15 22:19:57 |
| 合計ジャッジ時間 | 1,108 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <cstdlib>
#include <cmath>
#include <fstream>
int main(void) {
//test用
//std::ifstream in("test.txt");
//std::cin.rdbuf(in.rdbuf());
int N, K;
std::cin >> N >> K;
int max = 0;
int min = 1000;
for (int i = 0; i < N; i++) {
int temp;
std::cin >> temp;
if (temp >= max) {
max = temp;
}
if (temp <= min) {
min = temp;
}
}
std::cout << max - min << std::endl;
}
dgd1724