結果
| 問題 | No.135 とりあえず1次元の問題 |
| コンテスト | |
| ユーザー |
machy
|
| 提出日時 | 2015-06-11 12:11:43 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 26 ms / 5,000 ms |
| + 882µs | |
| コード長 | 502 bytes |
| 記録 | |
| コンパイル時間 | 387 ms |
| コンパイル使用メモリ | 85,720 KB |
| 実行使用メモリ | 9,904 KB |
| 最終ジャッジ日時 | 2026-10-11 11:09:09 |
| 合計ジャッジ時間 | 1,993 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long LL;
int main(){
LL N;
cin >> N;
vector<LL> point(N);
for(int i = 0; i < N; i++){
cin >> point[i];
}
sort(point.begin(), point.end());
LL ans = 1e+9;
for(int i = 1; i < point.size(); i++){
if(point[i] - point[i-1] > 0){
ans = min(ans, point[i] - point[i-1]);
}
}
if(ans == 1e+9) ans = 0;
cout << ans << endl;
return 0;
}
machy