-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBAEKJOON_11057
More file actions
42 lines (30 loc) ยท 928 Bytes
/
BAEKJOON_11057
File metadata and controls
42 lines (30 loc) ยท 928 Bytes
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
32
33
34
35
36
37
38
39
40
41
import java.io.*;
import java.sql.Array;
import java.util.*;
import java.util.stream.Stream;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int N = Integer.parseInt(br.readLine());
long[][] d = new long[N+1][10];
for(int i=0; i<10; i++){
d[1][i] = 1;
}
for(int i=2; i<=N; i++){
for(int j=0; j<=9; j++){
for(int k=0; k<=j; k++){
d[i][j] +=d[i-1][k];
}
d[i][j]%=10007;
}
}
long sum =0;
for(int i=0; i<10; i++){
sum = sum+d[N][i];
}
bw.write(String.valueOf(sum % 10007));
bw.flush();
bw.close();
}
}