結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー matriematrie
提出日時 2021-01-23 00:35:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 361 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 8,268 KB
最終ジャッジ日時 2023-08-28 10:15:24
合計ジャッジ時間 18,293 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,228 KB
testcase_01 AC 16 ms
8,180 KB
testcase_02 AC 16 ms
8,080 KB
testcase_03 AC 16 ms
8,072 KB
testcase_04 AC 16 ms
8,024 KB
testcase_05 AC 15 ms
8,088 KB
testcase_06 AC 16 ms
8,236 KB
testcase_07 AC 16 ms
8,120 KB
testcase_08 AC 16 ms
8,080 KB
testcase_09 AC 15 ms
8,140 KB
testcase_10 AC 15 ms
8,084 KB
testcase_11 AC 15 ms
8,140 KB
testcase_12 AC 16 ms
8,024 KB
testcase_13 AC 16 ms
8,076 KB
testcase_14 AC 17 ms
8,132 KB
testcase_15 AC 16 ms
8,224 KB
testcase_16 AC 16 ms
8,220 KB
testcase_17 AC 16 ms
8,132 KB
testcase_18 AC 15 ms
8,144 KB
testcase_19 AC 18 ms
8,152 KB
testcase_20 AC 17 ms
8,152 KB
testcase_21 AC 16 ms
8,072 KB
testcase_22 AC 18 ms
8,240 KB
testcase_23 AC 281 ms
8,084 KB
testcase_24 AC 601 ms
8,232 KB
testcase_25 TLE -
testcase_26 AC 41 ms
8,096 KB
testcase_27 AC 27 ms
8,032 KB
testcase_28 TLE -
testcase_29 AC 137 ms
8,136 KB
testcase_30 AC 281 ms
8,204 KB
testcase_31 AC 287 ms
8,084 KB
testcase_32 AC 72 ms
8,092 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 AC 16 ms
8,236 KB
testcase_44 TLE -
testcase_45 AC 15 ms
8,124 KB
testcase_46 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as it
n=int(input())
A=list(map(int,input().split()))
B=[list(map(int,input().split())) for _ in range(n)]
S=list(range(n))
y=-10**9
for m in range(1,n+1):
	for C in it.combinations(S,m):
		x=0
		for i in C:
			x+=A[i]
			x+=sum([B[i][j] for j in C])/2
			#print(C,x,[B[i][j] for j in C])
		if x>y:y=x;Y=C
print(int(y))
print(*[i+1 for i in Y])
0