結果
| 問題 | No.90 品物の並び替え |
| コンテスト | |
| ユーザー |
maatanbeta
|
| 提出日時 | 2017-04-26 12:26:07 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 4,620 ms / 5,000 ms |
| コード長 | 462 bytes |
| 記録 | |
| コンパイル時間 | 547 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 62,940 KB |
| 最終ジャッジ日時 | 2026-04-04 05:36:26 |
| 合計ジャッジ時間 | 7,758 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
import itertools
N, M = map(int, input().split())
item1 = [0] * M
item2 = [0] * M
score = [0] * M
max_score = 0
for i in range(M):
item1[i], item2[i], score[i] = map(int, input().split())
perm = [i for i in range(N)]
p = list(itertools.permutations(perm))
for ichi in p:
temp = 0
for i in range(M):
if ichi[item1[i]-1] < ichi[item2[i]-1]:
temp += score[i]
if temp > max_score:
max_score = temp
print(max_score)
maatanbeta