結果

問題 No.1446 ハンバーグと納豆ごはん
ユーザー shirokami
提出日時 2021-04-08 09:52:42
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 656 bytes
コンパイル時間 1,830 ms
コンパイル使用メモリ 194,016 KB
最終ジャッジ日時 2025-01-20 12:57:53
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O0")
typedef long long int ll;
typedef long double ld;
const ll mod = 1e9+7;
const ll INF = 1e18;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define Rep(i,a,n) for (ll i = (a); i < (n); ++i)
#define All(a) (a).begin(),(a).end()
#define Pi acos(-1)
using Graph = vector<vector<ll>>;
using V = vector<ll>;
using P = pair<ll,ll>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << setprecision(15) << fixed;

  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  ll ans = min(a,b);
  a -= ans;
  b -= ans;
  ans += b / (d+1);
  ans += a / (c+1);
  cout << ans << '\n';
  
}
0