結果

問題 No.90 品物の並び替え
コンテスト
ユーザー DrDrpilot
提出日時 2022-06-21 12:49:59
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 4,544 ms / 5,000 ms
+ 225µs
コード長 294 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 71 ms
コンパイル使用メモリ 80,384 KB
実行使用メモリ 108,160 KB
最終ジャッジ日時 2026-09-16 06:44:46
合計ジャッジ時間 7,814 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

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