結果
問題 | No.467 隠されていたゲーム |
ユーザー |
![]() |
提出日時 | 2017-08-20 09:22:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 724 bytes |
コンパイル時間 | 1,366 ms |
コンパイル使用メモリ | 161,556 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-14 17:19:36 |
合計ジャッジ時間 | 2,243 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 WA * 1 |
コンパイルメッセージ
main.cpp:15:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 15 | main(){ | ^~~~
ソースコード
#include <bits/stdc++.h> #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define FORR(i,a,b) for (int i=(a);i>=(b);i--) #define pb push_back using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; typedef set<int> si; const int inf = 1e9; const int mod = 1e9+7; int n, d[15], x, y; main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> n; FOR(i, 0, n){ cin >> d[i]; } sort(d, d+n); cin >> x >> y; x = max(abs(x), abs(y)); if(d[n-1] > x){ FOR(i, 0, n){ if(d[i] == x){ cout << 1 << endl; return 0; } } cout << 2 << endl; return 0; } ll ans = x / d[n-1]; if(x % d[n-1] > 0)ans++; cout << ans << endl; return 0; }