小球下落可看做取极限的过程
import java.util.*;
public class Balls {
public int calcDistance(int A, int B, int C, int D) {
return (A+B+C+D) * 3;
}
}
小球下落可看做取极限的过程
S=A+2∗A/2+2∗A/22+...+2∗A/2n
=A+A(1+1/2+1/22+...+1/2n−1)
=A+A∗1−2−11−2−n
=A(3−1/2n−1)
limx→∞S=3∗A
import java.util.*;
public class Balls {
public int calcDistance(int A, int B, int C, int D) {
return (A+B+C+D) * 3;
}
}