結果
問題 | No.467 隠されていたゲーム |
ユーザー |
![]() |
提出日時 | 2019-08-31 21:13:34 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 554 bytes |
コンパイル時間 | 613 ms |
コンパイル使用メモリ | 72,208 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-25 07:39:22 |
合計ジャッジ時間 | 1,496 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <algorithm>#include <iostream>#include <vector>using namespace std;int main() {int n; cin >> n;vector<int> d(n);for (int &di: d) cin >> di;int dmax = *max_element(d.begin(), d.end());int x, y; cin >> x >> y;int ma = max(abs(x), abs(y));if (ma == 0) {cout << 0 << endl;} else if (ma == *lower_bound(begin(d), end(d), ma)) {cout << 1 << endl;} else if (ma < dmax * 2) {cout << 2 << endl;} else {cout << (ma + dmax - 1) / dmax << endl;}return 0;}