結果

問題 No.90 品物の並び替え
ユーザー tnoda_tnoda_
提出日時 2015-08-07 20:47:13
言語 Python2
(2.7.18)
結果
AC  
実行時間 3,834 ms / 5,000 ms
コード長 318 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 6,664 KB
実行使用メモリ 6,180 KB
最終ジャッジ日時 2023-09-25 05:55:09
合計ジャッジ時間 5,751 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,932 KB
testcase_01 AC 284 ms
6,140 KB
testcase_02 AC 12 ms
6,072 KB
testcase_03 AC 30 ms
5,928 KB
testcase_04 AC 41 ms
6,180 KB
testcase_05 AC 321 ms
5,952 KB
testcase_06 AC 227 ms
6,076 KB
testcase_07 AC 15 ms
6,004 KB
testcase_08 AC 11 ms
6,132 KB
testcase_09 AC 3,834 ms
5,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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 range(M) if r[i1[i]] < r[i2[i]])
          for r in permutations(range(N))))
0