結果
| 問題 | No.90 品物の並び替え |
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2022-10-18 11:32:39 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
AC
|
| 実行時間 | 3,982 ms / 5,000 ms |
| コード長 | 318 bytes |
| 記録 | |
| コンパイル時間 | 435 ms |
| コンパイル使用メモリ | 20,568 KB |
| 実行使用メモリ | 15,228 KB |
| 最終ジャッジ日時 | 2026-03-17 23:07:59 |
| 合計ジャッジ時間 | 6,712 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
import itertools
import sys
readline=sys.stdin.readline
N,M=map(int,readline().split())
score=[tuple(map(int,readline().split())) for m in range(M)]
ans=0
for tpl in itertools.permutations([i for i in range(N)]):
S=0
for i,j,s in score:
if tpl[i]<tpl[j]:
S+=s
ans=max(ans,S)
print(ans)
vwxyz