結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,196 KB
testcase_01 AC 281 ms
6,064 KB
testcase_02 AC 11 ms
5,980 KB
testcase_03 AC 28 ms
6,088 KB
testcase_04 AC 39 ms
5,976 KB
testcase_05 AC 316 ms
5,928 KB
testcase_06 AC 220 ms
6,048 KB
testcase_07 AC 14 ms
5,952 KB
testcase_08 AC 11 ms
6,092 KB
testcase_09 AC 3,736 ms
5,948 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 xrange(M) if r[i1[i]] < r[i2[i]])
          for r in permutations(range(N))))
0