結果
| 問題 |
No.90 品物の並び替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-26 09:46:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 387 bytes |
| コンパイル時間 | 328 ms |
| コンパイル使用メモリ | 82,312 KB |
| 実行使用メモリ | 82,284 KB |
| 最終ジャッジ日時 | 2024-12-20 20:13:16 |
| 合計ジャッジ時間 | 9,063 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 TLE * 1 |
ソースコード
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)