結果
| 問題 |
No.90 品物の並び替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-07 18:55:10 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 580 bytes |
| コンパイル時間 | 165 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 21,888 KB |
| 最終ジャッジ日時 | 2024-09-17 14:00:53 |
| 合計ジャッジ時間 | 10,001 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 TLE * 1 |
ソースコード
import itertools
N, M = map(int, input().split())
score_table = []
for i in range(M):
score_table.append(list(map(int, input().split())))
perms = itertools.permutations(list(range(N)))
total_score_list = []
for perm in perms:
total_score = 0
for [back, forth, score] in score_table:
for elem in perm:
if elem == forth:
break
elif elem == back:
total_score += score
break
else:
continue
total_score_list.append(total_score)
print(max(total_score_list))