結果

問題 No.90 品物の並び替え
ユーザー Shin09shin
提出日時 2019-01-26 18:46:51
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 519 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 60,580 KB
最終ジャッジ日時 2024-09-17 10:46:07
合計ジャッジ時間 8,934 ms
ジャッジサーバーID
(参考情報)
judge6 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

n, m = map(int, input().split())

x = list(range(n))
y = list(itertools.permutations(x))
listA = []
listB = []
listC = []
listD = []
for i in range(1, m + 1):
    listA.append(list(map(int, input().split())))
    listE = listA[i - 1]
    listB.append(listE[0])
    listC.append(listE[1])
    listD.append(listE[2])
sum = 0

for z in y:
    list(z)
    temp = 0
    for w in range(0, m):
        if z.index(listB[w]) < z.index(listC[w]):
            temp += listD[w]
    sum = max(sum, temp)
print(sum)
0