結果
問題 |
No.467 隠されていたゲーム
|
ユーザー |
![]() |
提出日時 | 2016-12-19 15:48:45 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 471 bytes |
コンパイル時間 | 432 ms |
コンパイル使用メモリ | 56,408 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-14 08:59:19 |
合計ジャッジ時間 | 1,362 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 6 |
ソースコード
#include <iostream> #include <algorithm> using namespace std; int n; int d[15]; int x, y; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> d[i]; cin >> x >> y; int ans = 1145141919; for (int i = 0; i < n; i++) { int cnt; if (max(x, y) % d[i] == 0) { cnt = max(x, y) / d[i]; } else if (max(x, y) < d[i]) { cnt = 2; } else { cnt = max(x, y) / d[i] + 1; } ans = min(ans, cnt); } cout << ans << endl; return 0; } //自信ない