Lanqiao Cup official website fill-in-the-blank questions (double factorial)

Problem Description

The double factorial of a positive integer represents the product of all positive integers up to and including this positive integer and having the same parity as it. The double factorial of n is represented by n!!.

For example:

3!!=3×1=3

8!!=8×6×4×2=384

11!!=11×9×7×5×3×1=10395​

Excuse me, what are the last 5 digits (here refers to decimal digits) of 2021!!?

Note: 2021!!=2021×2019×⋯×5×3×1.

Tip: It is recommended to use computer programming to solve the problem.

answer submission

This is a fill-in-the-blank question, you just need to calculate the result and submit it. The result of this question is an integer. Only fill in this integer when submitting the answer. No points will be awarded for filling in excess content.

operating restrictions

  • Maximum running time: 1s
  • Maximum running memory: 256M
import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改

public class Main {
    public static void main(String[] args) {
      int sum=1;
        for(int i=1;i<=2021;i=i+2){
          sum=(sum*i)%100000;
        }
        System.out.println(sum);
    }
}

Guess you like

Origin blog.csdn.net/s44Sc21/article/details/132778900