結果
問題 | No.90 品物の並び替え |
ユーザー | akitsugu777 |
提出日時 | 2019-08-19 16:42:07 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
TLE
|
実行時間 | - |
コード長 | 322 bytes |
コンパイル時間 | 455 ms |
コンパイル使用メモリ | 10,708 KB |
実行使用メモリ | 62,124 KB |
最終ジャッジ日時 | 2023-07-27 16:37:14 |
合計ジャッジ時間 | 10,446 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
8,204 KB |
testcase_01 | AC | 882 ms
14,500 KB |
testcase_02 | AC | 15 ms
8,280 KB |
testcase_03 | AC | 64 ms
8,964 KB |
testcase_04 | AC | 102 ms
8,824 KB |
testcase_05 | AC | 1,012 ms
14,568 KB |
testcase_06 | AC | 672 ms
14,532 KB |
testcase_07 | AC | 25 ms
8,180 KB |
testcase_08 | AC | 16 ms
8,116 KB |
testcase_09 | TLE | - |
ソースコード
import itertools n, m = map(int,input().split()) n = [str(i) for i in range(n)] l1 = list(itertools.permutations(n)) l2 = [list(map(str,input().split())) for _ in range(m)] l = [] for i in l1: x = 0 for j in l2: if i.index(j[0]) < i.index(j[1]): x += int(j[2]) l.append(x) print(max(l))