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