結果
| 問題 | 
                            No.90 品物の並び替え
                             | 
                    
| コンテスト | |
| ユーザー | 
                             nbisco
                         | 
                    
| 提出日時 | 2016-08-30 23:19:03 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 452 bytes | 
| コンパイル時間 | 241 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 17,440 KB | 
| 最終ジャッジ日時 | 2024-11-14 12:41:58 | 
| 合計ジャッジ時間 | 9,212 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 8 TLE * 1 | 
ソースコード
import itertools
N, M = [int(i) for i in input().strip().split(" ")]
scores = []
for i in range(M):
    scores.append([int(j) for j in input().strip().split(" ")])
max_score = 0
for p in itertools.permutations([i for i in range(N)]):
    tmp_score = 0
    for score in scores:
        if p.index(score[0]) < p.index(score[1]):
            tmp_score += score[2]
    if max_score < tmp_score:
        max_score = tmp_score
print(max_score)
           
            
            
            
        
            
nbisco