結果
問題 | No.1446 ハンバーグと納豆ごはん |
ユーザー |
![]() |
提出日時 | 2021-03-31 14:26:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 539 bytes |
コンパイル時間 | 874 ms |
コンパイル使用メモリ | 81,056 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-14 19:08:26 |
合計ジャッジ時間 | 2,042 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i < n + 1; i++) #define all(A) A.begin(), A.end() typedef long long ll; int main() { ll a,b,n,m; cin >> a >> b >> n >> m; ll ans = 0; ans += min(a,b); a -= ans; b -= ans; if(a>0){ cout << ans+a/(n+1) << endl; }else{ cout << ans+b/(m+1) << endl; } }