結果
| 問題 | No.135 とりあえず1次元の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-11-29 21:44:38 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 639 bytes |
| 記録 | |
| コンパイル時間 | 578 ms |
| コンパイル使用メモリ | 77,680 KB |
| 実行使用メモリ | 10,112 KB |
| 最終ジャッジ日時 | 2026-06-06 14:42:07 |
| 合計ジャッジ時間 | 13,328 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | TLE * 1 -- * 21 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
ios::sync_with_stdio(false);
int n, input, d, min=10000000;
int x[100000];
int bDiffer=0;
cin >> n;
for(int i=0; i<100000; ++i) x[i]=min;
for(int i=0; i<n; ++i){
cin >> input;
x[i]=input;
cout << "input :" << input << "\tnow :" << i << "\n";
}
cout << "input complete.\n";
cout << "sort complete.\n";
for(int i=0; i<n-1; ++i){
for(int j=i+1; j<n; ++j){
d=x[i]-x[j];
d *= (d<0) ? -1 : 1;
if(d!=0 && min>d){
min=d;
bDiffer=1;
}
}
}
cout << min*bDiffer << "\n";
return 0;
}