結果

問題 No.804 野菜が苦手
ユーザー iwa_choco_168
提出日時 2019-12-03 16:36:58
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 583 bytes
コンパイル時間 1,776 ms
コンパイル使用メモリ 74,392 KB
実行使用メモリ 69,884 KB
最終ジャッジ日時 2024-11-27 09:48:48
合計ジャッジ時間 57,183 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample TLE * 2
other AC * 3 TLE * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int d = Integer.parseInt(sc.next());
        int tempA = 0, tempB = 0, ans = 0;
        while(tempA + tempB <= d) {
            if(tempA + 1 <= a && tempB + c <= b) {
                tempA++;
                tempB += c;
                ans++;
            }
        }
        System.out.println(--ans);
    }
}
0