結果

問題 No.804 野菜が苦手
ユーザー heyanxxheyanxx
提出日時 2019-07-09 16:42:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 777 bytes
コンパイル時間 3,011 ms
コンパイル使用メモリ 73,380 KB
実行使用メモリ 36,984 KB
最終ジャッジ日時 2024-04-20 12:40:01
合計ジャッジ時間 4,601 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
36,544 KB
testcase_01 AC 45 ms
36,896 KB
testcase_02 AC 44 ms
36,828 KB
testcase_03 AC 44 ms
36,720 KB
testcase_04 AC 44 ms
36,460 KB
testcase_05 AC 44 ms
36,680 KB
testcase_06 AC 44 ms
36,940 KB
testcase_07 AC 44 ms
36,476 KB
testcase_08 AC 43 ms
36,896 KB
testcase_09 AC 43 ms
36,572 KB
testcase_10 AC 44 ms
36,828 KB
testcase_11 AC 47 ms
36,700 KB
testcase_12 AC 43 ms
36,416 KB
testcase_13 AC 43 ms
36,792 KB
testcase_14 AC 43 ms
36,716 KB
testcase_15 AC 45 ms
36,840 KB
testcase_16 AC 43 ms
36,460 KB
testcase_17 AC 43 ms
36,844 KB
testcase_18 AC 44 ms
36,984 KB
testcase_19 AC 45 ms
36,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package test.demo;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Yukicoder804 {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		String[] str=input();
		int A=Integer.parseInt(str[0]);
		int B=Integer.parseInt(str[1]);
		int C=Integer.parseInt(str[2]);
		int D=Integer.parseInt(str[3]);
		int eatA=0;
		

			for(int j=1;j<=A&&j*C<=B;j++) {
				if((C+1)*j>D) {
					break;
				}
				eatA=j;
			}
		
		System.out.println(eatA);

	}
	public static  String[] input() throws IOException {
		BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
		
		String str=br.readLine();
		String[]str2=str.split(" ");
		
		return str2;
	}
}
0