結果
問題 | No.90 品物の並び替え |
ユーザー |
![]() |
提出日時 | 2022-03-14 05:37:33 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 792 ms / 5,000 ms |
コード長 | 380 bytes |
コンパイル時間 | 174 ms |
コンパイル使用メモリ | 82,136 KB |
実行使用メモリ | 76,152 KB |
最終ジャッジ日時 | 2024-09-19 14:59:02 |
合計ジャッジ時間 | 2,373 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
from itertools import permutations as pern,m=map(int,input().split())ms=[list(map(int,input().split())) for i in range(m)]ans=0for p in per(range(n)):dic={}for i in range(n):dic[p[i]] = ipoint=0for j in range(m):a,b,c=ms[j]if dic[a] < dic[b]:point+=cans=max(ans,point)print(ans)