結果
問題 | No.236 鴛鴦茶 |
ユーザー | Kmcode1 |
提出日時 | 2015-07-05 22:22:16 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 717 bytes |
コンパイル時間 | 884 ms |
コンパイル使用メモリ | 89,160 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 12:47:07 |
合計ジャッジ時間 | 1,481 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
#include<iostream> #include<cstdio> #include<cstring> #include<string> #include<cctype> #include<cstdlib> #include<algorithm> #include<bitset> #include<vector> #include<list> #include<deque> #include<queue> #include<map> #include<set> #include<stack> #include<cmath> #include<sstream> #include<fstream> #include<iomanip> #include<ctime> #include<complex> #include<functional> #include<climits> #include<cassert> #include<iterator> using namespace std; double a, b, x, y; int main(){ cin >> a >> b >> x >> y; double ans = x; ans *= b; ans /= a; double out = 0.0; if (ans <=y){ out = x + ans; } ans = y; ans *= a; ans /= b; if (ans <= x){ out = max(out, y + ans); } printf("%.16f\n", out); return 0; }