結果
問題 |
No.467 隠されていたゲーム
|
ユーザー |
![]() |
提出日時 | 2019-08-31 21:11:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 488 bytes |
コンパイル時間 | 479 ms |
コンパイル使用メモリ | 68,904 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-25 07:33:43 |
合計ジャッジ時間 | 1,361 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 2 |
ソースコード
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; int d = 0; while (n--) { int x; cin >> x; d = max(d, x); } int x, y; cin >> x >> y; int ma = max(abs(x), abs(y)); if (ma == 0) { cout << 0 << endl; } else if (ma == d) { cout << 1 << endl; } else if (ma < d * 2) { cout << 2 << endl; } else { cout << (ma + d - 1) / d << endl; } return 0; }