結果
問題 |
No.467 隠されていたゲーム
|
ユーザー |
![]() |
提出日時 | 2017-05-05 12:19:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 363 ms / 2,000 ms |
コード長 | 419 bytes |
コンパイル時間 | 1,768 ms |
コンパイル使用メモリ | 166,956 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-04 16:31:03 |
合計ジャッジ時間 | 2,496 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> #define REP(i,n,N) for(int i=(n);i<(int)N;i++) #define p(s) cout<<(s)<<endl using namespace std; int main(){ int n,x,y; cin>>n; int d[16]; int idou=0; REP(i,0,n) { cin>>d[i]; idou=max(idou,d[i]); } cin>>x>>y; int ans=-1; int goal=max(abs(x),abs(y)); if(goal==0) ans=0; if(ans<0) REP(i,0,n) if(goal == d[i]) ans=1; if(ans<0)for(ans=2;goal>idou*ans;ans++) ; p(ans); return 0; }