結果

問題 No.357 品物の並び替え (Middle)
ユーザー Snark86Snark86
提出日時 2016-04-01 23:56:18
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 322 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 13,212 KB
最終ジャッジ日時 2024-04-10 08:24:33
合計ジャッジ時間 10,748 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 884 ms
6,812 KB
testcase_01 AC 10 ms
6,940 KB
testcase_02 AC 59 ms
6,944 KB
testcase_03 AC 101 ms
6,944 KB
testcase_04 AC 1,026 ms
6,940 KB
testcase_05 AC 671 ms
6,944 KB
testcase_06 AC 19 ms
6,940 KB
testcase_07 AC 10 ms
6,944 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import sys

lines = sys.stdin.readlines()
n = map(int,lines[0].split())
sl = [map(int,lines[i+1].split()) for i in range(n[1])]

best = 0
for i in itertools.permutations(range(n[0])):
	score = 0
	for s in sl:
		if i.index(s[0]) > i.index(s[1]):
			score += s[2]
	if score > best:
		best = score
print best
0