結果

問題 No.90 品物の並び替え
コンテスト
ユーザー nbisco
提出日時 2016-08-30 23:19:03
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 452 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 57 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2026-09-22 10:20:51
合計ジャッジ時間 9,104 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import itertools
N, M = [int(i) for i in input().strip().split(" ")]
scores = []
for i in range(M):
    scores.append([int(j) for j in input().strip().split(" ")])

max_score = 0
for p in itertools.permutations([i for i in range(N)]):
    tmp_score = 0
    for score in scores:
        if p.index(score[0]) < p.index(score[1]):
            tmp_score += score[2]
    if max_score < tmp_score:
        max_score = tmp_score

print(max_score)
           
0