結果

問題 No.135 とりあえず1次元の問題
ユーザー Eclair1015Eclair1015
提出日時 2018-05-23 11:59:27
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 338 bytes
コンパイル時間 813 ms
コンパイル使用メモリ 51,360 KB
実行使用メモリ 5,312 KB
最終ジャッジ日時 2023-09-11 01:45:58
合計ジャッジ時間 18,995 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 TLE -
testcase_22 -- -
evil01.txt -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;
int main(){
	int X[100000];
	int memo=1000000;
	int N;
	
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>X[i];
	}
	if(N<=1){
		cout<<0<<endl;
		return 0;
	}
	for(int i=1;i<N;i++){
		for(int j=1;j<i;j++){
			if(memo>abs(X[i]-X[j])&&abs(X[i]-X[j])){
				memo=abs(X[i]-X[j]);
			}
		}
	}
	
	cout<<memo<<endl;
}
0