結果
問題 | No.90 品物の並び替え |
ユーザー | lloyz |
提出日時 | 2022-06-13 21:19:08 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 446 bytes |
コンパイル時間 | 100 ms |
コンパイル使用メモリ | 11,904 KB |
実行使用メモリ | 10,112 KB |
最終ジャッジ日時 | 2024-04-08 17:31:27 |
合計ジャッジ時間 | 8,434 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 35 ms
10,112 KB |
testcase_01 | AC | 519 ms
10,112 KB |
testcase_02 | AC | 34 ms
10,112 KB |
testcase_03 | AC | 83 ms
10,112 KB |
testcase_04 | AC | 83 ms
10,112 KB |
testcase_05 | AC | 534 ms
10,112 KB |
testcase_06 | AC | 491 ms
10,112 KB |
testcase_07 | AC | 40 ms
10,112 KB |
testcase_08 | AC | 31 ms
10,112 KB |
testcase_09 | TLE | - |
ソースコード
from itertools import permutations n, m = map(int, input().split()) C = [[-1 for _ in range(n)] for _ in range(n)] for _ in range(m): i, j, c = map(int, input().split()) C[i][j] = c ans = 0 for P in permutations(range(n)): res = 0 for i in range(n - 1): pi = P[i] for j in range(i + 1, n): pj = P[j] if C[pi][pj] != -1: res += C[pi][pj] ans = max(ans, res) print(ans)