結果
| 問題 | No.90 品物の並び替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-01-02 11:14:42 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 603 bytes |
| 記録 | |
| コンパイル時間 | 59 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2026-10-04 08:03:02 |
| 合計ジャッジ時間 | 26,155 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 6 TLE * 3 |
ソースコード
# coding: utf-8
# yukicoder No.90 品物の並び替え
from itertools import permutations
from itertools import combinations
def p_score(p, rule):
score = 0
for i in combinations(p, 2):
for c in rule:
if list(i) == c[:2]:
score += c[2]
break
return score
N, M = map(int, input().split())
rule = [[int(i) for i in input().split()] for _ in range(M)]
max_score = -1
# 総当たり
for p in permutations(range(N)):
score = p_score(p, rule)
if score > max_score:
max_score = score
print(max_score)