結果
問題 |
No.90 品物の並び替え
|
ユーザー |
![]() |
提出日時 | 2015-08-07 20:47:53 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 3,648 ms / 5,000 ms |
コード長 | 319 bytes |
コンパイル時間 | 70 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 05:02:56 |
合計ジャッジ時間 | 5,129 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
from itertools import permutations N, M = map(int, raw_input().strip().split()) i1 = [0] * M i2 = [0] * M score = [0] * M for i in range(M): i1[i], i2[i], score[i] = map(int, raw_input().strip().split()) print(max(sum(score[i] for i in xrange(M) if r[i1[i]] < r[i2[i]]) for r in permutations(range(N))))