Submission #1356886


Source Code Expand

n=int(raw_input())
dp=[[0]*(6*256+1) for _ in xrange(n+1)]
dp[0][0]=1
for i in xrange(n):
    for j in xrange(1,6*256+1):
        for k in xrange(1,7):
            if j-k<0:continue
            dp[i+1][j]+=dp[i][j-k]
ans=0
mx=0
for j in xrange(1, 6*256):
    if mx<dp[n][j]:
        ans=j
        mx=dp[n][j]
print ans

Submission Info

Submission Time
Task B - ダイスゲーム
User roto_37
Language Python (2.7.6)
Score 100
Code Size 332 Byte
Status AC
Exec Time 813 ms
Memory 17828 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 19
Set Name Test Cases
Sample sample-01.txt, sample-02.txt, sample-03.txt
All sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, sample-01.txt, sample-02.txt, sample-03.txt
Case Name Status Exec Time Memory
01-01.txt AC 22 ms 2692 KB
01-02.txt AC 25 ms 2692 KB
01-03.txt AC 28 ms 2692 KB
01-04.txt AC 31 ms 2692 KB
01-05.txt AC 34 ms 2692 KB
01-06.txt AC 37 ms 2692 KB
01-07.txt AC 40 ms 2692 KB
01-08.txt AC 811 ms 17828 KB
01-09.txt AC 813 ms 17708 KB
01-10.txt AC 375 ms 5964 KB
01-11.txt AC 194 ms 3708 KB
01-12.txt AC 594 ms 10712 KB
01-13.txt AC 393 ms 6212 KB
sample-01.txt AC 17 ms 2692 KB
sample-02.txt AC 20 ms 2692 KB
sample-03.txt AC 14 ms 2692 KB