結果
問題 | No.716 距離 |
ユーザー |
|
提出日時 | 2018-07-27 23:38:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 230 bytes |
コンパイル時間 | 501 ms |
コンパイル使用メモリ | 65,904 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 05:36:34 |
合計ジャッジ時間 | 1,650 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 40 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main() | ^~~~
ソースコード
#include<iostream>#include<algorithm>using namespace std;int a[1000],n,m=1e9,M;main(){cin>>n;for(int i=0;i<n;i++){cin>>a[i];for(int j=0;j<i;j++)m=min(m,a[i]-a[j]),M=max(M,a[i]-a[j]);}cout<<m<<endl<<M<<endl;}