結果
問題 | No.90 品物の並び替え |
ユーザー |
![]() |
提出日時 | 2018-12-24 01:59:13 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 440 bytes |
コンパイル時間 | 561 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 17,696 KB |
最終ジャッジ日時 | 2024-09-25 10:53:51 |
合計ジャッジ時間 | 10,596 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 8 TLE * 1 |
ソースコード
import itertools n, m = [int(x) for x in input().split()] tb = [] for i in range(m): tb += [[int(x) for x in input().split()]] res = 0 for v in itertools.permutations(range(n)): score = 0 for t in tb: it1, it2, sc = t[0], t[1], t[2] for vv in v: if vv == it1: score += sc break elif vv == it2: break res = max(score, res) print(res)