結果

問題 No.90 品物の並び替え
コンテスト
ユーザー T
提出日時 2025-11-23 15:14:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 331 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 17,828 KB
最終ジャッジ日時 2025-11-23 15:15:04
合計ジャッジ時間 9,923 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import itertools
N,M = map(int,input().split())
S = [tuple(map(int,input().split())) for i in range(M)]
score = 0

for item in itertools.permutations(range(N)):
  total = 0
  for a, b, s in S:
    if (item.index(a) < item.index(b)):
      total += s
    else:
      pass
      
  if (total > score):
    score = total

print(score)
0