結果
問題 |
No.467 隠されていたゲーム
|
ユーザー |
|
提出日時 | 2016-06-04 23:57:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 423 bytes |
コンパイル時間 | 1,247 ms |
コンパイル使用メモリ | 158,324 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 21:19:05 |
合計ジャッジ時間 | 2,088 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 6 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n,x,y; cin >> n; int d[n],D=0; for(int i=0; i<n; i++) { cin >> d[i]; D=max(D,d[i]); } cin >> x >> y; x=max(x,y); for(int i=0; i<n; i++) { if(d[i]==x) { cout << 1 << endl; return 0; } } int ans=ceil((double)max(0,x-2*D)/D); x-=ans*D; if(x==D) ans++; else if(x) ans+=2; cout << ans << endl; return 0; }