結果

問題 No.90 品物の並び替え
コンテスト
ユーザー T
提出日時 2025-11-23 15:08:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 291 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 17,956 KB
最終ジャッジ日時 2025-11-23 15:08:26
合計ジャッジ時間 10,171 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other WA * 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)):
    for a, b, s in S:
        if (item.index(a) < item.index(b)):
            score += s
        else:
        	pass

print(score)
0