結果

問題 No.90 品物の並び替え
コンテスト
ユーザー vwxyz
提出日時 2022-10-18 11:32:46
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 317 ms / 5,000 ms
コード長 318 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,022 ms
コンパイル使用メモリ 84,456 KB
実行使用メモリ 79,868 KB
最終ジャッジ日時 2026-03-17 23:07:46
合計ジャッジ時間 1,458 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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