結果

問題 No.90 品物の並び替え
ユーザー vwxyz
提出日時 2022-10-18 11:32:39
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 318 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 13,888 KB
最終ジャッジ日時 2024-06-28 20:24:26
合計ジャッジ時間 8,205 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import sys
readline=sys.stdin.readline

N,M=map(int,readline().split())
score=[tuple(map(int,readline().split())) for m in range(M)]
ans=0
for tpl in itertools.permutations([i for i in range(N)]):
    S=0
    for i,j,s in score:
        if tpl[i]<tpl[j]:
            S+=s
    ans=max(ans,S)
print(ans)
0