結果
| 問題 | No.135 とりあえず1次元の問題 |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-10-01 23:25:33 |
| 言語 | C++17(clang) (clang++ 22.1.8 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 11 ms / 5,000 ms |
| + 851µs | |
| コード長 | 422 bytes |
| 記録 | |
| コンパイル時間 | 7,224 ms |
| コンパイル使用メモリ | 164,636 KB |
| 実行使用メモリ | 9,904 KB |
| 最終ジャッジ日時 | 2026-10-01 23:25:55 |
| 合計ジャッジ時間 | 9,337 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge4_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
#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