結果

問題 No.467 隠されていたゲーム
ユーザー tsurukametsurukame
提出日時 2017-02-14 16:54:30
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,460 bytes
コンパイル時間 775 ms
コンパイル使用メモリ 104,624 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-04 16:27:20
合計ジャッジ時間 1,644 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

// c++11
#include <array>
#include <tuple>
#include <unordered_map>
#include <unordered_set>

#define mp make_pair
#define mt make_tuple
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

const int INF = 1 << 29;
const double EPS = 1e-9;
const ll MOD = 1000000007;

const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int N;
vector<ll> D;
ll X,Y;
int main() {
    cin >> N;
    D.resize(N);
    for (auto &val : D){
        cin >> val;
    }
    cin >> X >> Y;
    sort(D.begin(), D.end());
    ll max_XY = max(abs(X), abs(Y));
    ll max_d = D[N - 1];
    for (const auto &val : D){
        if (max_XY == val){
            cout << 1 << endl;
            return 0;
        }
    }
    ll res = max_XY / max_d;
    if (max_XY % max_d != 0){
        if (res == 0){
            res += 2;
        }else{
            res += 1;
        }
    }
    cout << res << endl;
   return 0;
 }
0