結果

問題 No.90 品物の並び替え
ユーザー DrDrpilotDrDrpilot
提出日時 2022-06-21 12:55:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,181 ms / 5,000 ms
コード長 312 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 82,488 KB
実行使用メモリ 88,724 KB
最終ジャッジ日時 2024-04-22 07:01:29
合計ジャッジ時間 2,698 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,608 KB
testcase_01 AC 144 ms
77,568 KB
testcase_02 AC 38 ms
52,224 KB
testcase_03 AC 53 ms
62,848 KB
testcase_04 AC 55 ms
63,104 KB
testcase_05 AC 146 ms
77,572 KB
testcase_06 AC 117 ms
77,440 KB
testcase_07 AC 48 ms
60,544 KB
testcase_08 AC 38 ms
51,968 KB
testcase_09 AC 1,181 ms
88,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

n,m=map(int,input().split())
lis=[list(map(int,input().split())) for _ in range(m)]
ans=[]
for per in permutations(range(n)):
    tmp=0
    per=list(per)
    for x,y,point in lis:
        if per.index(x)>per.index(y):
            tmp+=point
    ans.append(tmp)
print(max(ans))
0