結果
| 問題 | 
                            No.90 品物の並び替え
                             | 
                    
| コンテスト | |
| ユーザー | 
                             tnoda_
                         | 
                    
| 提出日時 | 2015-08-07 20:47:13 | 
| 言語 | Python2  (2.7.18)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 3,768 ms / 5,000 ms | 
| コード長 | 318 bytes | 
| コンパイル時間 | 40 ms | 
| コンパイル使用メモリ | 6,912 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-18 05:02:50 | 
| 合計ジャッジ時間 | 5,239 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 9 | 
ソースコード
from itertools import permutations
N, M = map(int, raw_input().strip().split())
i1 = [0] * M
i2 = [0] * M
score = [0] * M
for i in range(M):
    i1[i], i2[i], score[i] = map(int, raw_input().strip().split())
print(max(sum(score[i] for i in range(M) if r[i1[i]] < r[i2[i]])
          for r in permutations(range(N))))
            
            
            
        
            
tnoda_