結果
| 問題 |
No.90 品物の並び替え
|
| コンテスト | |
| ユーザー |
_matumo_
|
| 提出日時 | 2019-12-05 19:56:29 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 393 bytes |
| コンパイル時間 | 159 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-12-21 15:51:58 |
| 合計ジャッジ時間 | 8,721 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 TLE * 1 |
ソースコード
import itertools
def main():
N,M=map(int,input().split())
pa=[[0]*N for _ in range(N)]
for _ in range(M):
a,b,c=map(int,input().split())
pa[a][b]=c
Max=0
for p in itertools.permutations(range(N)):
sum=0
for d,e in itertools.permutations(p,2):
if p.index(d)<p.index(e): sum+=pa[d][e]
Max=max(Max,sum)
print(Max)
main()
_matumo_