結果

問題 No.90 品物の並び替え
ユーザー nohakai3nohakai3
提出日時 2022-11-01 20:32:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 501 ms / 5,000 ms
コード長 283 bytes
コンパイル時間 1,990 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 76,564 KB
最終ジャッジ日時 2023-09-23 10:27:24
合計ジャッジ時間 2,691 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,492 KB
testcase_01 AC 122 ms
76,016 KB
testcase_02 AC 68 ms
71,532 KB
testcase_03 AC 78 ms
76,148 KB
testcase_04 AC 78 ms
76,216 KB
testcase_05 AC 112 ms
76,116 KB
testcase_06 AC 97 ms
76,304 KB
testcase_07 AC 76 ms
76,108 KB
testcase_08 AC 68 ms
71,328 KB
testcase_09 AC 501 ms
76,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations


n,m=map(int,input().split())
score=[tuple(map(int,input().split())) for i in range(m)]
ans=0
for tpl in permutations([i for i in range(n)]):
    x=0
    for i,j,s in score:
        if tpl[i]<tpl[j]:
            x+=s
    ans=max(ans,x)

print(ans)
0