結果

問題 No.90 品物の並び替え
コンテスト
ユーザー nebukuro09
提出日時 2016-10-14 16:44:48
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 475 ms / 5,000 ms
コード長 312 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 136 ms
コンパイル使用メモリ 77,344 KB
最終ジャッジ日時 2025-12-03 22:02:27
ジャッジサーバーID
(参考情報)
judge5 / judge3
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from itertools import permutations

N, M = map(int, raw_input().split())
iis = [map(int, raw_input().split()) for _ in xrange(M)]

m1 = 0
for p in permutations(range(N)):
    m2 = 0
    for item1, item2, score in iis:
        if p[item1] < p[item2]:
            m2 += score
    m1 = max(m1, m2)
print m1        
0