結果

問題 No.135 とりあえず1次元の問題
ユーザー kotatsugame
提出日時 2016-12-21 20:37:01
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 208 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 68,980 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-11 07:08:46
合計ジャッジ時間 1,534 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 11 WA * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
main(){
	int n,a[1<<17],m=1<<30;cin>>n;
	for(int i=0;i<n;i++)cin>>a[i];
	sort(a,a+n);
	for(int i=0;i<n-1;i++)m=min(m,a[i+1]-a[i]);
	cout<<m<<endl;
}
0