結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
shimashima_k
|
| 提出日時 | 2015-04-29 15:31:03 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 454 bytes |
| コンパイル時間 | 1,432 ms |
| コンパイル使用メモリ | 159,868 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2025-01-03 05:35:42 |
| 合計ジャッジ時間 | 2,525 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 WA * 1 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
int main() {
int n;
cin >> n;
vector<int> x(n);
for (int i = 0; i < n; ++i) {
cin>>x[i];
}
sort(x.begin(), x.end());
int m = 999999;
for (int j = 0; j < x.size()-1; ++j) {
if (x[j+1] - x[j] != 0) {
m = min(m, x[j+1] - x[j]);
}
}
if (m == 999999) {
cout<<0<<endl;
} else{
cout<<m<<endl;
}
return 0;
}
shimashima_k