結果

問題 No.90 品物の並び替え
ユーザー bellangeldindonbellangeldindon
提出日時 2019-05-08 16:05:34
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 594 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 6,628 KB
実行使用メモリ 13,820 KB
最終ジャッジ日時 2023-09-14 17:21:29
合計ジャッジ時間 13,197 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,872 KB
testcase_01 AC 1,938 ms
13,640 KB
testcase_02 AC 12 ms
5,980 KB
testcase_03 AC 139 ms
6,720 KB
testcase_04 AC 161 ms
6,792 KB
testcase_05 AC 2,019 ms
13,820 KB
testcase_06 AC 1,835 ms
13,664 KB
testcase_07 AC 27 ms
5,980 KB
testcase_08 AC 11 ms
5,960 KB
testcase_09 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, raw_input().split())
sequence = [[]]
memo = []
while sequence != []:
	now = sequence.pop(0)
	if len(now) == N: memo.append(now)
	else:
		for i in range(0, N):
			newseq = []
			for j in range(0, len(now)):
				newseq.append(now[j])
			if i not in newseq:
				newseq.append(i)
				sequence.append(newseq)
pointlist = []
for i in range(0, M):
	pointlist.append(map(int, raw_input().split()))
max = 0
for i in range(0, len(memo)):
	sum = 0
	for j in range(0, M):
		if memo[i][pointlist[j][0]] < memo[i][pointlist[j][1]]:
			sum += pointlist[j][2]
	if max < sum: max = sum
print max
0