Submission details
Task:Dice Combinations
Sender:aalto26ch_036
Submission time:2026-09-13 21:38:44 +0300
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.04 sdetails
#2ACCEPTED0.04 sdetails
#3ACCEPTED0.04 sdetails
#4ACCEPTED0.04 sdetails
#5ACCEPTED0.04 sdetails
#6ACCEPTED0.04 sdetails
#70.04 sdetails
#80.04 sdetails
#90.04 sdetails
#100.04 sdetails
#110.04 sdetails
#120.04 sdetails
#130.05 sdetails
#140.08 sdetails
#150.10 sdetails
#160.10 sdetails
#170.10 sdetails
#180.04 sdetails
#190.10 sdetails
#200.04 sdetails

Code

'''Your task is to count the number of ways to construct sum n by throwing a dice one or more times. Each throw produces an outcome between 1 and  6.
For example, if n=3, there are 4 ways:

1+1+1
1+2
2+1
3

Input
The only input line has an integer n.
Output
Print the number of ways modulo 10^9+7.
Constraints


Example
Input:
3

Output:
4



3
111
1 2 
2 1 



4 

sum of ;
1 : dp(i=4-1) : 12 21 111 3
2 : dp(i=4-2) : 11 2
3: dp(1) : 1
4 : 1



3 :
1 : dp(2) : 11 2
2 : dp(1) : :1
3 : dp(0) : 0


Tasks
A Dice CombinationsB Card game
Your submissions'''

import sys
input_d = sys.stdin.read().split()
n = int(input_d[0])
dicevals = [i for i in range(1,7)]
vals = [0]*(n+1) 

for i in range(n+1):
    if i == 0 :
        vals[i] = 1
    for k in range(min(i,7)):
        vals[i]+= vals[k] % (10^9+7)

print(vals[n])




Test details

Test 1

Verdict: ACCEPTED

input
1

correct output
1

user output
1

Test 2

Verdict: ACCEPTED

input
2

correct output
2

user output
2

Test 3

Verdict: ACCEPTED

input
3

correct output
4

user output
4

Test 4

Verdict: ACCEPTED

input
4

correct output
8

user output
8

Test 5

Verdict: ACCEPTED

input
5

correct output
16

user output
16

Test 6

Verdict: ACCEPTED

input
6

correct output
32

user output
32

Test 7

Verdict:

input
7

correct output
63

user output
38

Feedback: Incorrect character on line 1 col 1: expected "63", got "38"

Test 8

Verdict:

input
8

correct output
125

user output
38

Feedback: Incorrect character on line 1 col 1: expected "125", got "38"

Test 9

Verdict:

input
9

correct output
248

user output
38

Feedback: Incorrect character on line 1 col 1: expected "248", got "38"

Test 10

Verdict:

input
10

correct output
492

user output
38

Feedback: Incorrect character on line 1 col 1: expected "492", got "38"

Test 11

Verdict:

input
50

correct output
660641036

user output
38

Feedback: Incorrect character on line 1 col 1: expected "660641036", got "38"

Test 12

Verdict:

input
1000

correct output
937196411

user output
38

Feedback: Incorrect character on line 1 col 1: expected "937196411", got "38"

Test 13

Verdict:

input
123456

correct output
113810539

user output
38

Feedback: Incorrect character on line 1 col 1: expected "113810539", got "38"

Test 14

Verdict:

input
654321

correct output
615247550

user output
38

Feedback: Incorrect character on line 1 col 1: expected "615247550", got "38"

Test 15

Verdict:

input
999998

correct output
39372206

user output
38

Feedback: Incorrect character on line 1 col 2: expected "39372206", got "38"

Test 16

Verdict:

input
999999

correct output
511319454

user output
38

Feedback: Incorrect character on line 1 col 1: expected "511319454", got "38"

Test 17

Verdict:

input
1000000

correct output
874273980

user output
38

Feedback: Incorrect character on line 1 col 1: expected "874273980", got "38"

Test 18

Verdict:

input
1001

correct output
94201505

user output
38

Feedback: Incorrect character on line 1 col 1: expected "94201505", got "38"

Test 19

Verdict:

input
999997

correct output
74225807

user output
38

Feedback: Incorrect character on line 1 col 1: expected "74225807", got "38"

Test 20

Verdict:

input
40

correct output
567401756

user output
38

Feedback: Incorrect character on line 1 col 1: expected "567401756", got "38"