結果
問題 | No.1360 [Zelkova 4th Tune] 協和音 |
ユーザー | H3PO4 |
提出日時 | 2021-01-22 21:38:00 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 481 bytes |
コンパイル時間 | 157 ms |
コンパイル使用メモリ | 10,880 KB |
実行使用メモリ | 34,140 KB |
最終ジャッジ日時 | 2023-08-27 17:57:24 |
合計ジャッジ時間 | 14,058 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 128 ms
34,052 KB |
testcase_01 | AC | 125 ms
29,756 KB |
testcase_02 | AC | 127 ms
29,656 KB |
testcase_03 | AC | 126 ms
29,604 KB |
testcase_04 | AC | 129 ms
29,800 KB |
testcase_05 | AC | 126 ms
29,708 KB |
testcase_06 | AC | 124 ms
29,716 KB |
testcase_07 | AC | 122 ms
29,760 KB |
testcase_08 | AC | 124 ms
29,812 KB |
testcase_09 | AC | 126 ms
29,868 KB |
testcase_10 | AC | 125 ms
29,692 KB |
testcase_11 | AC | 122 ms
29,604 KB |
testcase_12 | AC | 123 ms
29,796 KB |
testcase_13 | AC | 126 ms
29,688 KB |
testcase_14 | AC | 126 ms
29,756 KB |
testcase_15 | AC | 126 ms
29,840 KB |
testcase_16 | AC | 124 ms
29,680 KB |
testcase_17 | AC | 125 ms
29,708 KB |
testcase_18 | AC | 123 ms
29,696 KB |
testcase_19 | AC | 130 ms
29,836 KB |
testcase_20 | AC | 128 ms
29,836 KB |
testcase_21 | AC | 123 ms
29,844 KB |
testcase_22 | AC | 130 ms
29,732 KB |
testcase_23 | AC | 689 ms
29,756 KB |
testcase_24 | AC | 1,281 ms
29,720 KB |
testcase_25 | TLE | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
ソースコード
import itertools import numpy as np N = int(input()) A = np.array(tuple(map(int, input().split())), dtype=np.int64) B = np.array([tuple(map(int, input().split())) for _ in range(N)], dtype=np.int64) w = -float('inf') it = itertools.product((0, 1), repeat=N) next(it) for t in it: comp = list(itertools.compress(range(N), t)) tmp = A[comp].sum() + B[np.ix_(comp, comp)].sum() // 2 if w < tmp: J = tuple(x + 1 for x in comp) w = tmp print(w) print(*J)