結果
| 問題 | No.135 とりあえず1次元の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-11-29 21:44:38 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 639 bytes |
| 記録 | |
| コンパイル時間 | 291 ms |
| コンパイル使用メモリ | 79,616 KB |
| 実行使用メモリ | 9,928 KB |
| 最終ジャッジ日時 | 2026-10-10 12:04:08 |
| 合計ジャッジ時間 | 28,856 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 19 TLE * 3 |
ソースコード
#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;
}