結果

問題 No.90 品物の並び替え
ユーザー tomiyancetomiyance
提出日時 2019-11-20 20:07:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 336 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 59,136 KB
最終ジャッジ日時 2024-04-16 16:51:30
合計ジャッジ時間 9,179 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,880 KB
testcase_01 AC 671 ms
15,488 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 67 ms
11,264 KB
testcase_04 AC 92 ms
11,264 KB
testcase_05 AC 776 ms
15,488 KB
testcase_06 AC 529 ms
15,616 KB
testcase_07 AC 36 ms
10,752 KB
testcase_08 AC 30 ms
10,880 KB
testcase_09 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
N, M = map(int,input().split())
items = []
for i in range(1,M+1):
  items.append(list(map(int,input().split())))
max = 0
for v in list(itertools.permutations([x for x in range(N)])):
  sum = 0
  for item in items:
    if v.index(item[0]) < v.index(item[1]):
      sum += item[2]
  if max < sum:
    max = sum
print(max)
0