結果
| 問題 | 
                            No.236 鴛鴦茶
                             | 
                    
| コンテスト | |
| ユーザー | 
                             sasa
                         | 
                    
| 提出日時 | 2025-03-07 09:35:34 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 788 bytes | 
| コンパイル時間 | 496 ms | 
| コンパイル使用メモリ | 27,648 KB | 
| 実行使用メモリ | 8,612 KB | 
| 最終ジャッジ日時 | 2025-03-07 09:35:36 | 
| 合計ジャッジ時間 | 1,645 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 2 | 
| other | WA * 23 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:27:18: warning: format ‘%f’ expects argument of type ‘double’, but argument 2 has type ‘double*’ [-Wformat=]
   27 |         printf("%f",&ans);
      |                 ~^  ~~~~
      |                  |  |
      |                  |  double*
      |                  double
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%lf%lf",&ratio1,&ratio2);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%lf%lf",&overall1,&overall2);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include<stdio.h>
int main(){
	// 入力された値(割合)
	double ratio1, ratio2;
	scanf("%lf%lf",&ratio1,&ratio2);
	//printf("比率1:%f 比率1:%f\n",ratio1,ratio2);
	// 入力された値(全体)
	double overall1, overall2;
	scanf("%lf%lf",&overall1,&overall2);
	//printf("全体2:%f 全体2:%f\n",overall1,overall2);
	
	// 1回に作る分量
	double quantity1 = overall1 / ratio1;
	double quantity2 = overall2 / ratio2;
	//printf("分量1:%f 分量2:%f\n",quantity1,quantity2);
	
	// 全体製造量
	double ans = 0;
	while(0 < overall1 && 0 < overall2){
		overall1 -= quantity1;
		overall2 -= quantity2;
		//printf("計算後\n全体1:%f 全体2:%f",overall1,overall2);
		ans += (quantity1 + quantity2);
		//printf("製造量:%f\n",ans);
	}
	printf("%f",&ans);
}
            
            
            
        
            
sasa