結果
問題 |
No.90 品物の並び替え
|
ユーザー |
![]() |
提出日時 | 2017-07-20 00:20:26 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 472 bytes |
コンパイル時間 | 287 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 15,872 KB |
最終ジャッジ日時 | 2024-10-08 14:41:43 |
合計ジャッジ時間 | 9,836 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 8 TLE * 1 |
ソースコード
from itertools import permutations n,m = list(map(int, input().split(' '))) scores = [] for i in range(n): r = [0] * n scores.append(r) for i in range(m): left, right, score = list(map(int, input().split(' '))) scores[left][right] = score ms = -1 for p in permutations(range(n)): score = 0 for i in range(n-1): for j in range(i+1,n): score += scores[p[i]][p[j]] ms = max(ms, score) print(ms)