結果
| 問題 |
No.467 隠されていたゲーム
|
| ユーザー |
|
| 提出日時 | 2023-02-06 04:43:08 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 621 bytes |
| コンパイル時間 | 1,658 ms |
| コンパイル使用メモリ | 171,600 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-04 12:10:24 |
| 合計ジャッジ時間 | 2,312 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<ll> d(n);
for(auto &v:d) cin >> v;
ll x, y, d2;
cin >> x >> y;
d2 = max(abs(x), abs(y));
if(d2 == 0){
cout << 0 << '\n';
return 0;
}
for(int i = 0; i < n; i++){
if(d2 == d[i]){
cout << 1 << '\n';
return 0;
}
}
sort(d.begin(), d.end());
if(d2 < d.back()){
cout << 2 << '\n';
return 0;
}
cout << (d2 + d.back() - 1) / d.back() << '\n';
}