結果

問題 No.90 品物の並び替え
ユーザー zinnnia123zinnnia123
提出日時 2019-09-07 22:19:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 330 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 69,796 KB
最終ジャッジ日時 2023-09-09 13:15:03
合計ジャッジ時間 9,532 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,212 KB
testcase_01 AC 780 ms
14,532 KB
testcase_02 AC 15 ms
8,288 KB
testcase_03 AC 58 ms
8,932 KB
testcase_04 AC 93 ms
8,752 KB
testcase_05 AC 893 ms
14,544 KB
testcase_06 AC 611 ms
14,484 KB
testcase_07 AC 23 ms
8,288 KB
testcase_08 AC 15 ms
8,040 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):
    for j in range(len(A)):
       if A[j].index(score[i][0]) > A[j].index(score[i][1]):
           B[j] += score[i][2]

print(max(B))
0