結果

問題 No.1446 ハンバーグと納豆ごはん
ユーザー akiduki_104
提出日時 2021-03-31 15:53:36
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 539 bytes
コンパイル時間 1,763 ms
コンパイル使用メモリ 168,256 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-15 01:43:10
合計ジャッジ時間 2,965 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using intt = int64_t;
intt sum(const long &a, const long &b) { return (a + b) * (b - a + 1) / 2; }
vector<char> alphabet={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
int main() {
cout << fixed << setprecision(10);
  intt a,b,n,m;
  cin>>a>>b>>n>>m;
  intt x=min(a,b);
  intt y=max(a,b)-x;
  if(a>b){
      x+=y/(n+1);
  }
  else if(b>a){
      x+=y/(m+1);
  }
  cout<<x<<endl;
}
0