結果

問題 No.90 品物の並び替え
ユーザー asaka189asaka189
提出日時 2018-02-01 11:47:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 390 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 63,136 KB
最終ジャッジ日時 2023-08-29 21:57:31
合計ジャッジ時間 9,529 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,292 KB
testcase_01 AC 770 ms
14,644 KB
testcase_02 AC 16 ms
8,172 KB
testcase_03 AC 59 ms
9,028 KB
testcase_04 AC 92 ms
8,856 KB
testcase_05 AC 876 ms
14,764 KB
testcase_06 AC 590 ms
14,600 KB
testcase_07 AC 23 ms
8,316 KB
testcase_08 AC 16 ms
8,140 KB
testcase_09 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

n,m = map(int,input().split())
a = []
for i in range(m):
	temp = list(map(int,input().split()))
	a.append(temp)

seq = []
for i in range(n):
	seq.append(i)
c = list(itertools.permutations(seq))
score = []
k = len(c)
for p in range(k):
	total = 0
	for i in range(m):
		if c[p].index(a[i][0]) < c[p].index(a[i][1]):
			total += a[i][2]
	score.append(total)
print(max(score))
0