結果

問題 No.90 品物の並び替え
コンテスト
ユーザー nohakai3
提出日時 2022-11-01 20:32:07
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 338 ms / 5,000 ms
コード長 283 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 259 ms
コンパイル使用メモリ 84,992 KB
実行使用メモリ 80,128 KB
最終ジャッジ日時 2026-03-30 22:11:57
合計ジャッジ時間 2,143 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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