結果

問題 No.90 品物の並び替え
ユーザー vwxyzvwxyz
提出日時 2022-10-18 11:32:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 318 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 8,256 KB
最終ジャッジ日時 2023-09-11 06:11:01
合計ジャッジ時間 7,810 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,256 KB
testcase_01 AC 414 ms
8,044 KB
testcase_02 AC 16 ms
8,124 KB
testcase_03 AC 40 ms
8,192 KB
testcase_04 AC 57 ms
8,236 KB
testcase_05 AC 490 ms
8,240 KB
testcase_06 AC 324 ms
8,128 KB
testcase_07 AC 20 ms
8,136 KB
testcase_08 AC 16 ms
8,132 KB
testcase_09 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import sys
readline=sys.stdin.readline

N,M=map(int,readline().split())
score=[tuple(map(int,readline().split())) for m in range(M)]
ans=0
for tpl in itertools.permutations([i for i in range(N)]):
    S=0
    for i,j,s in score:
        if tpl[i]<tpl[j]:
            S+=s
    ans=max(ans,S)
print(ans)
0