結果
問題 |
No.135 とりあえず1次元の問題
|
ユーザー |
|
提出日時 | 2015-11-29 20:37:11 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 470 bytes |
コンパイル時間 | 863 ms |
コンパイル使用メモリ | 68,272 KB |
実行使用メモリ | 10,660 KB |
最終ジャッジ日時 | 2025-01-03 10:29:52 |
合計ジャッジ時間 | 30,139 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 WA * 1 TLE * 3 |
ソースコード
#include <iostream> #include <cmath> #include <vector> using namespace std; int main(){ ios::sync_with_stdio(false); int n, input, min=1000000; vector<int> x; int bDiffer=0; cin >> n; for(int i=0; i<n; ++i){ cin >> input; x.push_back(input); } for(int i=0; i<n; ++i){ for(int j=i+1; j<n; ++j){ if(x[i]!=x[j] && min > fabs(x[i]-x[j])){ min = fabs(x[i]-x[j]); bDiffer=1; } } } cout << min*bDiffer << "\n"; return 0; }