From d3b40a743fa71dac7a420e911ba8562689ef88d5 Mon Sep 17 00:00:00 2001 From: algorithmzuo Date: Fri, 17 Feb 2023 22:36:23 +0800 Subject: [PATCH] modify code --- .../第03期/mca_01/Code05_KokoEatingBananas.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MCA算法突击课/第03期/mca_01/Code05_KokoEatingBananas.java b/MCA算法突击课/第03期/mca_01/Code05_KokoEatingBananas.java index 163addc..400e9ae 100644 --- a/MCA算法突击课/第03期/mca_01/Code05_KokoEatingBananas.java +++ b/MCA算法突击课/第03期/mca_01/Code05_KokoEatingBananas.java @@ -29,8 +29,8 @@ public class Code05_KokoEatingBananas { // piles : 每一堆香蕉的个数,都在piles里 // speed : 猩猩的速度 // 在这个速度下,几小时吃完! - public static int hours(int[] piles, int speed) { - int ans = 0; + public static long hours(int[] piles, int speed) { + long ans = 0; int offset = speed - 1; for (int pile : piles) { ans += (pile + offset) / speed;