結果
| 問題 |
No.90 品物の並び替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-23 00:55:39 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 400 bytes |
| コンパイル時間 | 234 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 76,160 KB |
| 最終ジャッジ日時 | 2024-07-21 09:41:48 |
| 合計ジャッジ時間 | 2,632 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 8 |
ソースコード
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)