結果
| 問題 |
No.236 鴛鴦茶
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-10-02 14:42:02 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 401 bytes |
| コンパイル時間 | 198 ms |
| コンパイル使用メモリ | 30,336 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 12:57:40 |
| 合計ジャッジ時間 | 1,055 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / 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;
}