結果
問題 | No.467 隠されていたゲーム |
ユーザー |
|
提出日時 | 2023-02-06 04:38:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 617 bytes |
コンパイル時間 | 1,531 ms |
コンパイル使用メモリ | 171,792 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 12:07:09 |
合計ジャッジ時間 | 2,356 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 WA * 1 |
ソースコード
#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[0]){ cout << 2 << '\n'; return 0; } cout << (d2 + d.back() - 1) / d.back() << '\n'; }