結果
問題 | No.90 品物の並び替え |
ユーザー |
![]() |
提出日時 | 2015-08-07 20:42:53 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 3,440 ms / 5,000 ms |
コード長 | 389 bytes |
コンパイル時間 | 406 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,528 KB |
最終ジャッジ日時 | 2024-07-18 05:02:34 |
合計ジャッジ時間 | 5,272 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
from itertools import permutationsN, M = map(int, raw_input().strip().split())i1 = [0] * Mi2 = [0] * Mscore = [0] * Mfor i in range(M):i1[i], i2[i], score[i] = map(int, raw_input().strip().split())def total(r):res = 0for i in range(M):if r[i1[i]] < r[i2[i]]:res += score[i]return resprint(max(total(r) for r in permutations(range(N))))