結果

問題 No.2733 Just K-times TSP
ユーザー hato336hato336
提出日時 2024-04-19 21:56:14
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 825 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 82,452 KB
実行使用メモリ 849,832 KB
最終ジャッジ日時 2024-04-19 21:56:23
合計ジャッジ時間 8,017 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
64,892 KB
testcase_01 AC 58 ms
66,464 KB
testcase_02 AC 37 ms
52,636 KB
testcase_03 AC 35 ms
51,968 KB
testcase_04 AC 36 ms
52,096 KB
testcase_05 AC 36 ms
52,480 KB
testcase_06 AC 53 ms
64,512 KB
testcase_07 AC 37 ms
51,968 KB
testcase_08 AC 41 ms
52,480 KB
testcase_09 AC 61 ms
70,400 KB
testcase_10 AC 50 ms
62,592 KB
testcase_11 AC 51 ms
63,488 KB
testcase_12 AC 67 ms
73,728 KB
testcase_13 AC 58 ms
66,176 KB
testcase_14 AC 128 ms
82,388 KB
testcase_15 AC 138 ms
82,560 KB
testcase_16 AC 84 ms
78,884 KB
testcase_17 AC 1,103 ms
168,816 KB
testcase_18 AC 1,164 ms
168,660 KB
testcase_19 AC 1,328 ms
168,776 KB
testcase_20 AC 232 ms
93,792 KB
testcase_21 AC 675 ms
142,032 KB
testcase_22 MLE -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k = map(int,input().split())
edge = [[] for i in range(n)]
for i in range(m):
    u,v = map(int,input().split())
    u-=1
    v-=1
    edge[u].append(v)
    edge[v].append(u)
mod = 998244353
x = (k+1)**n
dp = [[[0 for j in range((k+1)**n)] for erf in range(n)] for erg3rg in range(n*k)]
kk = [(k+1)**i for i in range(n)]
for i in range(n):
    dp[0][i][(k+1)**i] = 1
for i in range(n*k-1):
    for y in range(x):
        yy = y
        temp = []
        for wfw in range(n):
            temp.append(yy%(k+1))
            yy //= k+1
        for f in range(n):
            for to in edge[f]:
                if temp[to] >= k:
                    continue
                dp[i+1][to][y + kk[to]] += dp[i][f][y]
                dp[i+1][to][y + kk[to]] %= mod
ans = 0
for i in range(n):
    ans += dp[-1][i][-1]
print(ans%mod)
0