結果
問題 | No.236 鴛鴦茶 |
ユーザー |
![]() |
提出日時 | 2015-10-04 10:12:59 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 414 bytes |
コンパイル時間 | 396 ms |
コンパイル使用メモリ | 30,464 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 12:57:44 |
合計ジャッジ時間 | 1,028 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:16:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | scanf("%lf %lf %lf %lf",&a,&b,&x,&y); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <math.h> #include <ctype.h> #define REP(i,k,n) for(int i=k;i<n;i++) #define rep(i,n) for(int i=0;i<n;i++) typedef long long ll; int main(void) { int i,j,k,l; double a,b,x,y; double ans; scanf("%lf %lf %lf %lf",&a,&b,&x,&y); if( y/x >= b/a ) { ans = x; ans += (x * b) / a; } else { ans = y; ans += (y * a) / b; } printf("%lf\n",ans); return 0; }