結果

問題 No.804 野菜が苦手
ユーザー ameame
提出日時 2019-03-22 21:27:13
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 590 bytes
コンパイル時間 2,511 ms
コンパイル使用メモリ 74,092 KB
実行使用メモリ 57,700 KB
最終ジャッジ日時 2023-10-19 06:26:03
合計ジャッジ時間 6,200 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 135 ms
57,352 KB
testcase_02 AC 136 ms
57,500 KB
testcase_03 AC 135 ms
57,460 KB
testcase_04 AC 140 ms
57,428 KB
testcase_05 AC 142 ms
57,448 KB
testcase_06 AC 142 ms
57,520 KB
testcase_07 AC 136 ms
57,480 KB
testcase_08 WA -
testcase_09 AC 141 ms
57,216 KB
testcase_10 AC 142 ms
57,660 KB
testcase_11 AC 146 ms
57,460 KB
testcase_12 AC 140 ms
57,556 KB
testcase_13 AC 139 ms
57,448 KB
testcase_14 AC 139 ms
57,356 KB
testcase_15 AC 135 ms
57,452 KB
testcase_16 AC 139 ms
57,416 KB
testcase_17 AC 138 ms
57,148 KB
testcase_18 AC 145 ms
57,460 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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