結果

問題 No.90 品物の並び替え
ユーザー zinnnia123zinnnia123
提出日時 2019-09-08 01:21:11
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 360 bytes
コンパイル時間 1,533 ms
コンパイル使用メモリ 86,520 KB
実行使用メモリ 136,040 KB
最終ジャッジ日時 2023-09-09 22:19:54
合計ジャッジ時間 9,892 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,932 KB
testcase_01 AC 563 ms
83,172 KB
testcase_02 AC 71 ms
71,264 KB
testcase_03 AC 112 ms
77,364 KB
testcase_04 AC 133 ms
77,304 KB
testcase_05 AC 640 ms
83,312 KB
testcase_06 AC 456 ms
83,212 KB
testcase_07 AC 85 ms
76,288 KB
testcase_08 AC 69 ms
71,520 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