結果
| 問題 | No.90 品物の並び替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-23 23:04:10 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 1,107 ms / 5,000 ms |
| コード長 | 521 bytes |
| コンパイル時間 | 243 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,368 KB |
| 最終ジャッジ日時 | 2025-11-23 23:04:14 |
| 合計ジャッジ時間 | 2,758 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
N,M = map(int,input().split()) score = [[0]*N for i in range(N)] for j in range(M): item1,item2,s = map(int,input().split()) score[item2][item1] = s ans = 0 def tokuten(n,used,count): global ans if (len(n) == N): ans = max(ans,count) return for item in range(N): if (used[item] == True): continue else: add = 0 for mae in n: add += score[item][mae] used[item] = True tokuten(n + [item], used, count + add) used[item] = False used = [False] * N tokuten([],used,0) print(ans)