結果
| 問題 | No.90 品物の並び替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-23 00:55:10 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 400 bytes |
| 記録 | |
| コンパイル時間 | 731 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 23,200 KB |
| 最終ジャッジ日時 | 2026-04-03 04:17:30 |
| 合計ジャッジ時間 | 15,731 ms |
|
ジャッジサーバーID (参考情報) |
judge5_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 7 TLE * 1 |
ソースコード
from itertools import permutations
N,M = map(int,input().split())
l = [[] for _ in range(N)]
ans = 0
for _ in range(M):
i,y,s = map(int,input().split())
l[i].append([y,s])
for perm in permutations(range(N)):
perm = list(perm)
now = 0
for i in range(N):
for item,score in l[i]:
if item in perm[:i]:
now += score
ans = max(ans,now)
print(ans)