結果

問題 No.804 野菜が苦手
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2019-03-22 21:41:04
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 542 bytes
コンパイル時間 2,321 ms
コンパイル使用メモリ 74,044 KB
実行使用メモリ 57,592 KB
最終ジャッジ日時 2023-10-19 06:39:33
合計ジャッジ時間 6,247 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 135 ms
57,392 KB
testcase_02 AC 134 ms
57,332 KB
testcase_03 WA -
testcase_04 AC 130 ms
57,392 KB
testcase_05 AC 131 ms
57,028 KB
testcase_06 AC 137 ms
57,592 KB
testcase_07 WA -
testcase_08 AC 136 ms
57,580 KB
testcase_09 AC 134 ms
57,508 KB
testcase_10 AC 135 ms
57,548 KB
testcase_11 AC 133 ms
57,072 KB
testcase_12 AC 134 ms
57,432 KB
testcase_13 AC 136 ms
57,376 KB
testcase_14 AC 137 ms
57,116 KB
testcase_15 AC 135 ms
57,500 KB
testcase_16 AC 133 ms
57,356 KB
testcase_17 AC 137 ms
57,372 KB
testcase_18 AC 135 ms
57,112 KB
testcase_19 AC 132 ms
57,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int ans = 0;
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        for( ; ans <= a; ans++) {
            if(ans * c > b) {
                ans--;
                break;
            }
            if(ans * (c + 1) > d) {
                ans--;
                break;
            }
        }
        System.out.println(ans);
    }
}
0