結果
問題 |
No.90 品物の並び替え
|
ユーザー |
![]() |
提出日時 | 2016-08-30 23:34:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 4,044 ms / 5,000 ms |
コード長 | 473 bytes |
コンパイル時間 | 490 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-11-14 12:42:05 |
合計ジャッジ時間 | 6,663 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
import itertools N, M = [int(i) for i in input().strip().split(" ")] scores = [[0]*N for i in range(N)] for i in range(M): x,y,score = [int(j) for j in input().strip().split(" ")] scores[x][y] = score max_score = 0 for p in itertools.permutations(range(N)): tmp_score = 0 for i in range(N): score = scores[p[i]] for j in p[i:]: tmp_score += score[j] if max_score < tmp_score: max_score = tmp_score print(max_score)