結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-25 10:49:45 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 389 bytes |
| コンパイル時間 | 435 ms |
| コンパイル使用メモリ | 59,480 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-15 15:35:53 |
| 合計ジャッジ時間 | 1,987 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 WA * 1 |
ソースコード
#include <iostream>
#include <vector>
#define SZ 1000000
using namespace std;
bool X[SZ + 1];
int main()
{
int i, N, x, d = SZ + 1;
cin >> N;
for (i = 0; i < N; i++)
X[cin >> x, x] = true;
vector<int> p;
for (i = 0; i <= SZ; i++)
if(X[i]) p.push_back(i);
for (i = 0; i < p.size() - 1; i++)
if (d > p[i + 1] - p[i]) d = p[i + 1] - p[i];
cout << d << endl;
return 0;
}