結果
| 問題 | No.135 とりあえず1次元の問題 |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-10-01 23:25:33 |
| 言語 | C++17(clang) (clang++ 23.1.3 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 11 ms / 5,000 ms |
| + 509µs | |
| コード長 | 422 bytes |
| 記録 | |
| コンパイル時間 | 2,274 ms |
| コンパイル使用メモリ | 167,200 KB |
| 実行使用メモリ | 9,744 KB |
| 最終ジャッジ日時 | 2026-10-11 13:35:44 |
| 合計ジャッジ時間 | 4,022 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int n, a[100005], Ans;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n; Ans = 1e9;
for (int i = 1; i <= n; i++) cin >> a[i];
sort(a + 1, a + n + 1);
for (int i = 2; i <= n; i++) {
if (a[i] == a[i - 1]) continue;
Ans = min(Ans, a[i] - a[i - 1]);
}
if (Ans != 1e9) cout << Ans;
else cout << 0;
}
vjudge1