結果

問題 No.90 品物の並び替え
ユーザー DrDrpilot
提出日時 2022-06-21 12:49:59
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 294 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 104,872 KB
最終ジャッジ日時 2024-10-14 06:10:21
合計ジャッジ時間 8,705 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

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