結果

問題 No.90 品物の並び替え
コンテスト
ユーザー yansi819
提出日時 2024-05-26 09:46:46
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 387 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 370 ms
コンパイル使用メモリ 80,752 KB
実行使用メモリ 83,096 KB
最終ジャッジ日時 2026-10-12 03:37:27
合計ジャッジ時間 17,156 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from itertools import permutations
N, M = map(int, input().split())
S = []
for _ in range(M):
    s = list(map(int, input().split()))
    S.append(s)
A = [i for i in range(N)]
MAX = 0
for v in permutations(A):
    SUM = 0
    for s in S:
        index1 = v.index(s[0])
        index2 = v.index(s[1])
        if index1 < index2:
            SUM += s[2]
    MAX = max(MAX, SUM)
print(MAX)
0