結果
問題 |
No.135 とりあえず1次元の問題
|
ユーザー |
|
提出日時 | 2015-05-09 00:38:30 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 482 bytes |
コンパイル時間 | 725 ms |
コンパイル使用メモリ | 58,236 KB |
実行使用メモリ | 8,832 KB |
最終ジャッジ日時 | 2025-01-03 05:48:29 |
合計ジャッジ時間 | 19,824 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 WA * 4 TLE * 2 |
ソースコード
#include <iostream> #include <stdlib.h> using namespace std; int main(){ int n; cin>>n; int x[n]; int absv = 1000000; int abst; int j; cin>>x[0]; for (int i = 1; i < n ; ++i) { cin>>x[i]; for (j = 0; j <= i-1; ++j) { abst=abs(x[i]-x[j]); if(abst == 0){ if(i == j){ continue; } cout<<"0"<<endl; return 0; } if(absv == 1){ cout<<"1"<<endl; return 0; } if( abst <= absv ){ absv = abst; } } } cout<<absv<<endl; }