結果
問題 | No.63 ポッキーゲーム |
ユーザー | r.suzuki |
提出日時 | 2016-01-25 01:17:17 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 1,069 ms / 5,000 ms |
コード長 | 698 bytes |
コンパイル時間 | 3,162 ms |
コンパイル使用メモリ | 72,200 KB |
実行使用メモリ | 56,588 KB |
最終ジャッジ日時 | 2023-08-25 19:04:01 |
合計ジャッジ時間 | 10,079 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 121 ms
55,896 KB |
testcase_01 | AC | 119 ms
55,528 KB |
testcase_02 | AC | 120 ms
56,060 KB |
testcase_03 | AC | 121 ms
56,028 KB |
testcase_04 | AC | 118 ms
56,544 KB |
testcase_05 | AC | 118 ms
56,084 KB |
testcase_06 | AC | 120 ms
56,008 KB |
testcase_07 | AC | 123 ms
55,820 KB |
testcase_08 | AC | 120 ms
56,064 KB |
testcase_09 | AC | 125 ms
55,708 KB |
testcase_10 | AC | 135 ms
56,132 KB |
testcase_11 | AC | 1,069 ms
56,088 KB |
testcase_12 | AC | 146 ms
55,992 KB |
testcase_13 | AC | 1,066 ms
55,504 KB |
testcase_14 | AC | 146 ms
54,440 KB |
testcase_15 | AC | 145 ms
56,284 KB |
testcase_16 | AC | 129 ms
55,684 KB |
testcase_17 | AC | 1,011 ms
56,588 KB |
testcase_18 | AC | 128 ms
56,224 KB |
testcase_19 | AC | 254 ms
55,776 KB |
testcase_20 | AC | 143 ms
55,884 KB |
testcase_21 | AC | 166 ms
55,896 KB |
ソースコード
class Human{ int eatLength; int eatedPokkey; public Human(int i){ this.eatLength = i; this.eatedPokkey = 0; } } public class No_63{ public static void main(String[] args){ java.util.Scanner sc = new java.util.Scanner(System.in); int pokkey = sc.nextInt(); int k = sc.nextInt(); Human haruka = new Human(k); Human yuu = new Human(k); while(pokkey > 0){ if(pokkey - (haruka.eatLength + yuu.eatLength) > 0){ haruka.eatedPokkey += haruka.eatLength; yuu.eatedPokkey += yuu.eatLength; pokkey -= haruka.eatLength + yuu.eatLength; } else{ haruka.eatedPokkey += pokkey; pokkey = 0; } } System.out.println(yuu.eatedPokkey); sc.close(); } }