結果

問題 No.804 野菜が苦手
ユーザー sakaki_tohru
提出日時 2019-03-22 21:28:08
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 1,028 ms
コンパイル使用メモリ 96,748 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 02:47:36
合計ジャッジ時間 1,555 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iomanip>
#include <cmath>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <vector>
#include <bitset>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include<iostream>
#include<map>
#include<algorithm>

using namespace std;

int main() {
	int a, b, c, d; cin >> a >> b >> c >> d;

	int ans = min(a, b / c);

	if (ans + ans * c <= d) {
		cout << ans << endl;
	}
	else {
		while (ans+ans*c>d) {
			ans--;
		}
		cout << ans << endl;
	}

	return 0;
}
0