結果

問題 No.90 品物の並び替え
ユーザー nohakai3
提出日時 2022-11-01 20:32:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 450 ms / 5,000 ms
コード長 283 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 82,196 KB
実行使用メモリ 75,040 KB
最終ジャッジ日時 2024-07-16 09:59:11
合計ジャッジ時間 1,639 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations


n,m=map(int,input().split())
score=[tuple(map(int,input().split())) for i in range(m)]
ans=0
for tpl in permutations([i for i in range(n)]):
    x=0
    for i,j,s in score:
        if tpl[i]<tpl[j]:
            x+=s
    ans=max(ans,x)

print(ans)
0