結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
cowgirl
|
| 提出日時 | 2018-10-08 19:49:59 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 424 bytes |
| コンパイル時間 | 1,598 ms |
| コンパイル使用メモリ | 166,192 KB |
| 実行使用メモリ | 10,404 KB |
| 最終ジャッジ日時 | 2024-10-12 15:37:52 |
| 合計ジャッジ時間 | 14,008 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | TLE * 1 -- * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
if(n==1){
cout << 0 << endl;
return 0;
}
int minx=1000001;
int x[100010];
for(int i=0; i < n; i++) cin >> x[i];
for(int i=0; i < n; i++){
for(int j=i+1; j < n; j++){
if(x[i] == x[j]) continue;
minx = min(abs(x[i] - x[j]) , minx);
}
}
cout << minx << endl;
}
cowgirl