結果
| 問題 | No.90 品物の並び替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-23 15:22:52 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 4,111 ms / 5,000 ms |
| + 383µs | |
| コード長 | 383 bytes |
| 記録 | |
| コンパイル時間 | 307 ms |
| コンパイル使用メモリ | 21,412 KB |
| 実行使用メモリ | 15,868 KB |
| 最終ジャッジ日時 | 2026-07-16 22:44:47 |
| 合計ジャッジ時間 | 7,602 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
import itertools
N, M = map(int, input().split())
S = [tuple(map(int, input().split())) for i in range(M)]
score = 0
for order in itertools.permutations(range(N)):
pos = [0]*N
for i, item in enumerate(order):
pos[item] = i
total = 0
for a, b, s in S:
if (pos[a] < pos[b]):
total += s
else:
pass
if (total > score):
score = total
print(score)