結果
| 問題 | No.1446 ハンバーグと納豆ごはん | 
| コンテスト | |
| ユーザー |  やう | 
| 提出日時 | 2021-03-31 15:19:34 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 382 bytes | 
| コンパイル時間 | 1,969 ms | 
| コンパイル使用メモリ | 165,864 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-12-14 23:37:08 | 
| 合計ジャッジ時間 | 3,213 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 33 | 
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using ll=long long;
using ld=long double;
using namespace std;
using P=pair<int,int>;
int main(){
  ll a,b,n,m;
  cin >> a >> b >> n >> m;
  ll ans=min(a,b);
  if(a==b){
    cout << ans << endl;
  }
  else if(a<b){
    b-=a;
    cout << ans+b/(m+1) << endl;
  }
  else{
    a-=b;
    cout << ans+a/(n+1) << endl;
  }
}
            
            
            
        