結果

問題 No.2807 Have Another Go (Easy)
ユーザー hirayuu_ychirayuu_yc
提出日時 2024-07-05 11:26:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 3,000 ms
コード長 380 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 82,104 KB
実行使用メモリ 85,124 KB
最終ジャッジ日時 2024-07-06 14:19:27
合計ジャッジ時間 5,291 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
51,968 KB
testcase_01 AC 110 ms
84,480 KB
testcase_02 AC 108 ms
82,208 KB
testcase_03 AC 97 ms
80,228 KB
testcase_04 AC 61 ms
78,848 KB
testcase_05 AC 107 ms
83,176 KB
testcase_06 AC 106 ms
83,072 KB
testcase_07 AC 78 ms
77,508 KB
testcase_08 AC 77 ms
80,672 KB
testcase_09 AC 83 ms
79,360 KB
testcase_10 AC 65 ms
79,396 KB
testcase_11 AC 114 ms
84,204 KB
testcase_12 AC 116 ms
84,352 KB
testcase_13 AC 113 ms
84,204 KB
testcase_14 AC 113 ms
84,828 KB
testcase_15 AC 120 ms
85,120 KB
testcase_16 AC 117 ms
84,020 KB
testcase_17 AC 118 ms
85,124 KB
testcase_18 AC 114 ms
84,488 KB
testcase_19 AC 117 ms
84,736 KB
testcase_20 AC 113 ms
84,472 KB
testcase_21 AC 117 ms
84,080 KB
testcase_22 AC 117 ms
84,560 KB
testcase_23 AC 120 ms
84,516 KB
testcase_24 AC 116 ms
84,608 KB
testcase_25 AC 115 ms
84,464 KB
testcase_26 AC 117 ms
84,148 KB
testcase_27 AC 115 ms
84,540 KB
testcase_28 AC 115 ms
84,444 KB
testcase_29 AC 113 ms
84,864 KB
testcase_30 AC 113 ms
84,160 KB
testcase_31 AC 39 ms
60,160 KB
testcase_32 AC 38 ms
59,392 KB
testcase_33 AC 41 ms
60,800 KB
testcase_34 AC 39 ms
59,264 KB
testcase_35 AC 37 ms
59,776 KB
testcase_36 AC 49 ms
65,024 KB
testcase_37 AC 40 ms
59,648 KB
testcase_38 AC 64 ms
76,020 KB
testcase_39 AC 39 ms
59,008 KB
testcase_40 AC 64 ms
76,512 KB
testcase_41 AC 65 ms
76,168 KB
testcase_42 AC 63 ms
76,404 KB
testcase_43 AC 56 ms
73,472 KB
testcase_44 AC 58 ms
74,688 KB
testcase_45 AC 56 ms
71,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def gt(n):
    ret=0
    for i in range(1,7):
        if n-i>=0:
            ret+=dp[n-i]*(7-i)
    return ret
MOD=998244353
N,M,k=map(int,input().split())
C=list(map(int,input().split()))
dp=[0]*(N*2+20)
dp[0]=1
for i in range(N*2+10):
    dp[i]%=MOD
    for j in range(1,7):
        dp[i+j]+=dp[i]
for c in C:
    print((dp[c]*gt(N*2-c)+dp[N+c]*gt(N-c)-dp[c]*dp[N]*gt(N-c))%MOD)
0