[Offer收割]编程练习赛71 register

Ended

Participants:147

Verdict:Wrong Answer
Score:0 / 100
Submitted:2018-08-05 14:20:31

Lang:Java

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        long a = 0;
        for(int i=0;i<=N-3;i++)
        {
            if(i == 0 || i == N-3)
            {
                a += 9*Math.pow(10N-3-1);
            }
            else
            {
                a += 9*Math.pow(10i-1)+9*Math.pow(10N-3-i-1);
            }
            if(i >= 4)
            {
                for(int j=0;j<i-3;j++)
                {
                    a -= (Math.pow(10j)+Math.pow(10i-j-3));
                }
                a += 2;
            }
        }
        System.out.println((a)%1000000007);
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX