結果
| 問題 | No.90 品物の並び替え |
| コンテスト | |
| ユーザー |
brthyyjp
|
| 提出日時 | 2020-09-20 04:14:18 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 312 ms / 5,000 ms |
| + 980µs | |
| コード長 | 393 bytes |
| 記録 | |
| コンパイル時間 | 69 ms |
| コンパイル使用メモリ | 80,640 KB |
| 実行使用メモリ | 83,120 KB |
| 最終ジャッジ日時 | 2026-10-12 03:15:44 |
| 合計ジャッジ時間 | 2,265 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 |
ソースコード
n, m = map(int, input().split())
X = []
for i in range(m):
a, b, s = map(int, input().split())
X.append((a, b, s))
import itertools
ans = 0
for p in itertools.permutations(range(n)):
q = [0]*n
temp = 0
for i, e in enumerate(p):
q[e] = i
for i in range(m):
a, b, s = X[i]
if q[a] < q[b]:
temp += s
ans = max(ans, temp)
print(ans)
brthyyjp