結果

問題 No.90 品物の並び替え
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2021-12-05 20:35:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 298 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 10,604 KB
実行使用メモリ 12,612 KB
最終ジャッジ日時 2023-09-21 15:00:55
合計ジャッジ時間 8,379 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,280 KB
testcase_01 AC 478 ms
8,116 KB
testcase_02 AC 15 ms
8,184 KB
testcase_03 AC 43 ms
8,276 KB
testcase_04 AC 64 ms
8,180 KB
testcase_05 AC 570 ms
8,148 KB
testcase_06 AC 362 ms
8,088 KB
testcase_07 AC 21 ms
8,112 KB
testcase_08 AC 16 ms
8,156 KB
testcase_09 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
iis = [tuple(map(int,input().split())) for _ in range(M)]

from itertools import permutations
ans = 0
for p in permutations([i for i in range(N)]):
    tmp = 0
    for i1,i2,s in iis:
        if p[i1-1] < p[i2-1]:
           tmp += s
    ans = max(ans,tmp)
print(ans)
0