結果

問題 No.804 野菜が苦手
ユーザー takahiro-serikawa
提出日時 2019-04-14 07:27:44
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 287 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 20,864 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-16 05:12:15
合計ジャッジ時間 1,070 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12 WA * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d%d%d%d", &A, &B, &C, &D);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>

int main()
{
        int A, B, C, D;
        scanf("%d%d%d%d", &A, &B, &C, &D);

        int n = D / (1+C);
        if (n > A)
                n = A;
        if (n*C > B)
                n = B / (n*C);
        printf("%d\n", n);
        exit(0);
}
0