結果
問題 |
No.90 品物の並び替え
|
ユーザー |
![]() |
提出日時 | 2024-09-24 15:59:59 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 370 bytes |
コンパイル時間 | 277 ms |
コンパイル使用メモリ | 82,540 KB |
実行使用メモリ | 76,216 KB |
最終ジャッジ日時 | 2024-09-24 16:00:01 |
合計ジャッジ時間 | 1,510 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 9 |
ソースコード
from itertools import permutations n,m=map(int,input().split()) items=[[0]*n for _ in range(n)] for _ in range(m): item1,item2,score=map(int,input().split()) item1,item2=item1-1,item2-1 items[item1][item2]=score ans=0 for P in permutations(range(n)): tmp=0 for i in range(n-1): tmp+=items[P[i]][P[i+1]] ans=max(ans,tmp) print(ans)