結果
問題 |
No.135 とりあえず1次元の問題
|
ユーザー |
![]() |
提出日時 | 2018-01-23 22:21:52 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 501 bytes |
コンパイル時間 | 1,538 ms |
コンパイル使用メモリ | 64,716 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 03:48:39 |
合計ジャッジ時間 | 1,823 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 WA * 1 |
ソースコード
#include<iostream> #include<vector> #include<algorithm> #include<cstdio> using namespace std; int main(){ vector<long long> vc; long long N,x,m=10000000; bool flag; cin >> N; while(N--){ cin >> x; vc.push_back(x); } sort(vc.begin(),vc.end()); for(long long i=1;i<vc.size();i++){ if((vc[i]-vc[i-1])){ flag=1; m = min(m,(vc[i]-vc[i-1])); } } if(flag) cout << m; else cout << '0'; return 0; }