結果
| 問題 |
No.90 品物の並び替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-31 11:42:17 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 376 bytes |
| コンパイル時間 | 100 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 60,712 KB |
| 最終ジャッジ日時 | 2024-11-18 09:45:13 |
| 合計ジャッジ時間 | 8,595 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 TLE * 1 |
ソースコード
# 2019/12/31
from itertools import permutations
n,m=map(int,input().split())
items=[tuple(map(int,input().split())) for _ in range(m)]
ps=list(permutations(range(n),n))
ans=0
for p in ps:
cnt=0
pp=[None]*n
for i in range(n):
pp[p[i]]=i
for item in items:
u,v,c=item
if pp[u]<pp[v]:
cnt+=c
ans=max(ans,cnt)
print(ans)