結果
問題 |
No.90 品物の並び替え
|
ユーザー |
![]() |
提出日時 | 2016-06-28 22:41:00 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 211 ms / 5,000 ms |
コード長 | 393 bytes |
コンパイル時間 | 321 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 75,700 KB |
最終ジャッジ日時 | 2024-10-11 22:02:26 |
合計ジャッジ時間 | 1,701 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
import itertools N, M = map(int, input().split()) score = [[0 for j in range(N)] for i in range(N)] for i in range(M): a, b, s = map(int, input().split()) score[a][b] = s max_score = 0 for p in itertools.permutations(range(N)): s = 0 for i in range(N - 1): for j in range(i + 1, N): s += score[p[i]][p[j]] max_score = max(max_score, s) print(max_score)