結果

問題 No.90 品物の並び替え
ユーザー DrDrpilotDrDrpilot
提出日時 2022-06-21 12:49:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 294 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 23,936 KB
最終ジャッジ日時 2024-04-22 06:56:09
合計ジャッジ時間 9,530 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,624 KB
testcase_01 AC 780 ms
12,288 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 71 ms
10,880 KB
testcase_04 AC 104 ms
10,880 KB
testcase_05 AC 870 ms
12,416 KB
testcase_06 AC 611 ms
12,416 KB
testcase_07 AC 37 ms
10,752 KB
testcase_08 AC 30 ms
10,752 KB
testcase_09 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

n,m=map(int,input().split())
lis=[list(map(int,input().split())) for _ in range(m)]
ans=[]
for per in permutations(range(n)):
    tmp=0
    for x,y,point in lis:
        if per.index(x)>per.index(y):
            tmp+=point
    ans.append(tmp)
print(max(ans))
0