結果
問題 |
No.135 とりあえず1次元の問題
|
ユーザー |
|
提出日時 | 2016-12-21 20:38:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 228 bytes |
コンパイル時間 | 1,100 ms |
コンパイル使用メモリ | 69,700 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-11 07:09:24 |
合計ジャッジ時間 | 1,742 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 WA * 1 |
コンパイルメッセージ
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<<endl; }