結果

問題 No.90 品物の並び替え
ユーザー zinnnia123zinnnia123
提出日時 2019-09-07 23:32:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 360 bytes
コンパイル時間 574 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 69,716 KB
最終ジャッジ日時 2023-09-09 20:56:58
合計ジャッジ時間 9,002 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,324 KB
testcase_01 AC 655 ms
14,760 KB
testcase_02 AC 15 ms
8,280 KB
testcase_03 AC 50 ms
9,016 KB
testcase_04 AC 80 ms
9,000 KB
testcase_05 AC 765 ms
14,608 KB
testcase_06 AC 497 ms
14,656 KB
testcase_07 AC 22 ms
8,288 KB
testcase_08 AC 15 ms
8,272 KB
testcase_09 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

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

A = list(itertools.permutations(list(range(N))))
B = [0]*len(A)

for i in range(M):
    K = score[i][0]
    L = score[i][1]
    T = score[i][2]
    for j in range(len(A)):
       if A[j].index(K) > A[j].index(L):
           B[j] += T

print(max(B))
0