結果

問題 No.90 品物の並び替え
コンテスト
ユーザー DrDrpilot
提出日時 2022-06-21 12:49:26
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 294 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 57 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 25,216 KB
最終ジャッジ日時 2026-09-16 06:43:52
合計ジャッジ時間 10,291 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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