結果
| 問題 | No.90 品物の並び替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-07 18:47:15 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 516 bytes |
| 記録 | |
| コンパイル時間 | 288 ms |
| コンパイル使用メモリ | 21,416 KB |
| 実行使用メモリ | 26,108 KB |
| 最終ジャッジ日時 | 2026-08-29 15:10:09 |
| 合計ジャッジ時間 | 10,018 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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:
index_back = perm.index(back)
index_forth = perm.index(forth)
if index_back < index_forth:
total_score += score
total_score_list.append(total_score)
print(max(total_score_list))