結果
| 問題 |
No.467 隠されていたゲーム
|
| コンテスト | |
| ユーザー |
__NCAstar
|
| 提出日時 | 2016-12-17 23:14:47 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 665 bytes |
| コンパイル時間 | 575 ms |
| コンパイル使用メモリ | 63,848 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-04 16:17:44 |
| 合計ジャッジ時間 | 1,410 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include<iostream>
#include<cmath>
#include<algorithm>
#include<climits>
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
using namespace std;
typedef long long ll;
#define MAX 30
int n;
ll d[MAX];
ll x,y;
void compute() {
if( x == 0 && y == 0 ) {
puts("0");
return;
}
x = llabs(x), y = llabs(y);
sort(d,d+n);
if( max(x,y) < d[n-1] ) {
rep(i,n) {
if( max(x,y) == d[i] ) {
cout << 1 << endl;
return;
}
}
cout << 2 << endl;
} else {
ll ans = ceil( max(x,y) / (double)d[n-1] );
cout << ans << endl;
}
}
int main() {
cin >> n;
rep(i,n) cin >> d[i];
cin >> x >> y;
compute();
}
__NCAstar