結果
問題 |
No.135 とりあえず1次元の問題
|
ユーザー |
|
提出日時 | 2015-11-29 20:35:46 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 473 bytes |
コンパイル時間 | 837 ms |
コンパイル使用メモリ | 69,500 KB |
実行使用メモリ | 17,480 KB |
最終ジャッジ日時 | 2025-01-03 10:26:51 |
合計ジャッジ時間 | 29,770 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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=pow(10, 6); 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; }