結果
問題 |
No.90 品物の並び替え
|
ユーザー |
![]() |
提出日時 | 2015-08-07 20:48:14 |
言語 | PyPy2 (7.3.15) |
結果 |
AC
|
実行時間 | 726 ms / 5,000 ms |
コード長 | 319 bytes |
コンパイル時間 | 1,166 ms |
コンパイル使用メモリ | 76,936 KB |
実行使用メモリ | 79,652 KB |
最終ジャッジ日時 | 2024-07-18 05:03:00 |
合計ジャッジ時間 | 3,475 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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))))