結果

問題 No.804 野菜が苦手
ユーザー kazapyon27kazapyon27
提出日時 2019-03-28 21:54:50
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 699 bytes
コンパイル時間 3,109 ms
コンパイル使用メモリ 73,592 KB
実行使用メモリ 37,068 KB
最終ジャッジ日時 2024-04-22 15:59:54
合計ジャッジ時間 4,976 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
36,984 KB
testcase_01 AC 52 ms
36,520 KB
testcase_02 WA -
testcase_03 AC 50 ms
36,760 KB
testcase_04 AC 51 ms
36,596 KB
testcase_05 AC 51 ms
36,924 KB
testcase_06 AC 51 ms
36,920 KB
testcase_07 AC 50 ms
36,892 KB
testcase_08 WA -
testcase_09 AC 50 ms
36,924 KB
testcase_10 AC 50 ms
36,712 KB
testcase_11 AC 48 ms
37,068 KB
testcase_12 AC 50 ms
36,604 KB
testcase_13 AC 51 ms
36,936 KB
testcase_14 AC 51 ms
36,920 KB
testcase_15 AC 51 ms
36,560 KB
testcase_16 AC 51 ms
36,492 KB
testcase_17 AC 51 ms
36,912 KB
testcase_18 WA -
testcase_19 AC 51 ms
36,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*No.804 野菜が苦手*/
import java.io.*;
public class No804{
	public static void main(String[] args) {
		try(BufferedReader input =new BufferedReader(new InputStreamReader(System.in))){
			String[]s_input=input.readLine().split(" ");
			byte ordered_vegetables=Byte.parseByte(s_input[0]);
			byte ordered_meat=Byte.parseByte(s_input[1]);
			byte multiple=Byte.parseByte(s_input[2]);
			byte capacity=Byte.parseByte(s_input[3]);
			while(ordered_vegetables*multiple>ordered_meat){
				ordered_vegetables--;
			}
			if(ordered_vegetables>capacity){
				System.out.println(capacity);
			}else{
				System.out.println(ordered_vegetables);
			}
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
0