結果

問題 No.90 品物の並び替え
ユーザー tnoda_tnoda_
提出日時 2015-08-07 20:48:14
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 848 ms / 5,000 ms
コード長 319 bytes
コンパイル時間 1,285 ms
コンパイル使用メモリ 77,660 KB
実行使用メモリ 80,600 KB
最終ジャッジ日時 2023-09-25 05:55:21
合計ジャッジ時間 4,079 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
76,320 KB
testcase_01 AC 202 ms
79,552 KB
testcase_02 AC 73 ms
76,648 KB
testcase_03 AC 114 ms
79,780 KB
testcase_04 AC 136 ms
79,772 KB
testcase_05 AC 217 ms
80,600 KB
testcase_06 AC 182 ms
80,124 KB
testcase_07 AC 99 ms
79,088 KB
testcase_08 AC 74 ms
76,480 KB
testcase_09 AC 848 ms
80,572 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