結果
| 問題 | No.90 品物の並び替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-22 23:45:40 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 365 ms / 5,000 ms |
| + 130µs | |
| コード長 | 304 bytes |
| 記録 | |
| コンパイル時間 | 70 ms |
| コンパイル使用メモリ | 80,892 KB |
| 実行使用メモリ | 82,816 KB |
| 最終ジャッジ日時 | 2026-10-12 03:35:54 |
| 合計ジャッジ時間 | 2,364 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 |
ソースコード
from itertools import permutations
N, M = map(int, input().split())
table = [tuple(map(int, input().split())) for j in range(M)]
ans = 0
for pos in permutations(range(N)):
tot = 0
for item1, item2, score in table:
if pos[item1] < pos[item2]:
tot += score
ans = max(ans, tot)
print(ans)