白给题
给了前十项 问第202420242024项是多少
20和24的倍数交替 又因为从小到大排列,第9项和第10项相同
20 24 40 48 60 72 80 96 120 120 140 144........;
实际上就是求(24*101210121012)
直接用BigInteger 秒了
import java.math.BigInteger;
public class Main {
public static void main(String[] args) {
BigInteger a1 = BigInteger.valueOf(24);
BigInteger a2 = BigInteger.valueOf(101210121012l);
System.out.println(a2.multiply(a1).toString());
}
}