結果

問題 No.2807 Have Another Go (Easy)
ユーザー PNJPNJ
提出日時 2024-07-12 22:02:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 3,000 ms
コード長 547 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 82,536 KB
実行使用メモリ 88,680 KB
最終ジャッジ日時 2024-07-12 22:02:56
合計ジャッジ時間 6,112 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,928 KB
testcase_01 AC 129 ms
87,672 KB
testcase_02 AC 116 ms
83,196 KB
testcase_03 AC 94 ms
81,936 KB
testcase_04 AC 79 ms
81,164 KB
testcase_05 AC 107 ms
85,208 KB
testcase_06 AC 107 ms
85,384 KB
testcase_07 AC 68 ms
70,820 KB
testcase_08 AC 81 ms
80,804 KB
testcase_09 AC 85 ms
80,016 KB
testcase_10 AC 92 ms
81,816 KB
testcase_11 AC 121 ms
88,092 KB
testcase_12 AC 127 ms
88,056 KB
testcase_13 AC 136 ms
88,000 KB
testcase_14 AC 128 ms
88,228 KB
testcase_15 AC 120 ms
88,008 KB
testcase_16 AC 123 ms
87,944 KB
testcase_17 AC 125 ms
87,896 KB
testcase_18 AC 123 ms
87,936 KB
testcase_19 AC 126 ms
88,680 KB
testcase_20 AC 128 ms
87,924 KB
testcase_21 AC 132 ms
87,964 KB
testcase_22 AC 129 ms
87,956 KB
testcase_23 AC 129 ms
88,272 KB
testcase_24 AC 124 ms
88,544 KB
testcase_25 AC 122 ms
87,872 KB
testcase_26 AC 125 ms
87,840 KB
testcase_27 AC 124 ms
87,868 KB
testcase_28 AC 129 ms
87,988 KB
testcase_29 AC 122 ms
87,932 KB
testcase_30 AC 142 ms
88,124 KB
testcase_31 AC 48 ms
61,732 KB
testcase_32 AC 46 ms
60,828 KB
testcase_33 AC 49 ms
61,148 KB
testcase_34 AC 48 ms
61,124 KB
testcase_35 AC 48 ms
61,948 KB
testcase_36 AC 59 ms
65,308 KB
testcase_37 AC 47 ms
61,768 KB
testcase_38 AC 65 ms
67,472 KB
testcase_39 AC 50 ms
59,588 KB
testcase_40 AC 62 ms
67,412 KB
testcase_41 AC 61 ms
66,688 KB
testcase_42 AC 65 ms
67,716 KB
testcase_43 AC 63 ms
66,692 KB
testcase_44 AC 63 ms
67,064 KB
testcase_45 AC 59 ms
65,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
N,M,k = map(int,input().split())
dp = [0 for i in range(3*N + 1)]
dp[0] = 1
for n in range(2*N):
  for c in range(1,7):
    dp[min(2*N,n+c)] += dp[n]
    dp[min(2*N,n+c)] %= mod

C = list(map(int,input().split()))

for c in C:
  a = dp[c]
  r = 0
  for i in range(-6,0):
    j = 7 + i
    r += j * dp[2*N+i-c] % mod
  a = a * r % mod
  
  c += N
  b = dp[c]
  r = 0
  for i in range(-6,0):
    j = 7 + i
    r += j * dp[2*N+i-c] % mod
  b = b * r % mod
  
  c = dp[c-N] * dp[N] % mod
  c = c * r % mod
  
  print((a + b - c) % mod)
0