結果

問題 No.90 品物の並び替え
ユーザー Shin09shinShin09shin
提出日時 2019-01-26 18:46:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 519 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 11,876 KB
実行使用メモリ 14,956 KB
最終ジャッジ日時 2023-10-17 12:40:52
合計ジャッジ時間 10,386 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,104 KB
testcase_01 AC 775 ms
14,952 KB
testcase_02 AC 29 ms
10,100 KB
testcase_03 AC 72 ms
10,616 KB
testcase_04 AC 103 ms
10,620 KB
testcase_05 AC 895 ms
14,956 KB
testcase_06 AC 606 ms
14,952 KB
testcase_07 AC 37 ms
10,172 KB
testcase_08 AC 29 ms
10,100 KB
testcase_09 TLE -
権限があれば一括ダウンロードができます

ソースコード

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