結果

問題 No.90 品物の並び替え
ユーザー nebukuro09
提出日時 2016-10-14 16:45:05
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 478 ms / 5,000 ms
コード長 312 bytes
コンパイル時間 1,775 ms
コンパイル使用メモリ 76,720 KB
実行使用メモリ 77,576 KB
最終ジャッジ日時 2024-11-22 06:47:05
合計ジャッジ時間 3,908 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

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