結果
| 問題 |
No.467 隠されていたゲーム
|
| コンテスト | |
| ユーザー |
hotpepsi
|
| 提出日時 | 2016-12-22 01:45:29 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 530 bytes |
| コンパイル時間 | 695 ms |
| コンパイル使用メモリ | 66,152 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-04 16:22:04 |
| 合計ジャッジ時間 | 1,577 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include <iostream>
#include <sstream>
#include <algorithm>
#include <set>
#include <vector>
#include <cstring>
using namespace std;
typedef long long LL;
int main(int argc, char *argv[]) {
int n;
cin >> n;
LL d[16] = {};
for (int i = 0; i < n; ++i) {
cin >> d[i];
}
LL x, y;
cin >> x >> y;
LL z = max(abs(x), abs(y));
sort(d, d + n);
LL ans = (z + d[n - 1] - 1) / d[n - 1];
if (ans > 0 && ans < 3) {
if (find(d, d + n, z) < (d + n)) {
ans = 1;
} else {
ans = 2;
}
}
cout << ans << endl;
return 0;
}
hotpepsi