結果

問題 No.357 品物の並び替え (Middle)
コンテスト
ユーザー Snark86
提出日時 2016-04-01 23:56:18
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
TLE  
実行時間 -
コード長 322 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 58 ms
コンパイル使用メモリ 80,788 KB
実行使用メモリ 83,072 KB
最終ジャッジ日時 2026-07-18 04:47:42
合計ジャッジ時間 13,026 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 TLE * 1 -- * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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