結果
| 問題 | No.135 とりあえず1次元の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-12-21 20:39:12 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 26 ms / 5,000 ms |
| + 778µs | |
| コード長 | 241 bytes |
| 記録 | |
| コンパイル時間 | 493 ms |
| コンパイル使用メモリ | 85,524 KB |
| 実行使用メモリ | 9,900 KB |
| 最終ジャッジ日時 | 2026-11-20 20:45:53 |
| 合計ジャッジ時間 | 2,509 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
ソースコード
#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]?a[i+1]-a[i]:1<<30));
cout<<(m==1<<30?0:m)<<endl;
}