結果
問題 | No.804 野菜が苦手 |
ユーザー | kazapyon27 |
提出日時 | 2019-03-30 00:55:59 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 724 bytes |
コンパイル時間 | 3,387 ms |
コンパイル使用メモリ | 73,304 KB |
実行使用メモリ | 37,048 KB |
最終ジャッジ日時 | 2024-04-24 16:54:54 |
合計ジャッジ時間 | 4,823 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 49 ms
36,708 KB |
testcase_02 | AC | 48 ms
36,532 KB |
testcase_03 | AC | 48 ms
36,424 KB |
testcase_04 | AC | 51 ms
36,856 KB |
testcase_05 | AC | 51 ms
36,452 KB |
testcase_06 | AC | 49 ms
36,712 KB |
testcase_07 | AC | 47 ms
36,432 KB |
testcase_08 | AC | 46 ms
36,860 KB |
testcase_09 | AC | 46 ms
36,988 KB |
testcase_10 | AC | 50 ms
37,048 KB |
testcase_11 | AC | 50 ms
37,012 KB |
testcase_12 | AC | 53 ms
36,900 KB |
testcase_13 | AC | 50 ms
36,472 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 48 ms
36,724 KB |
testcase_17 | AC | 48 ms
36,964 KB |
testcase_18 | AC | 49 ms
36,736 KB |
testcase_19 | WA | - |
ソースコード
/*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--; } while(ordered_vegetables+ordered_meat>capacity){ ordered_vegetables--; ordered_meat-=multiple; } System.out.println(ordered_vegetables); }catch(Exception e){ e.printStackTrace(); } } }