結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー 👑 KazunKazun
提出日時 2021-01-04 03:00:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 429 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 80,792 KB
最終ジャッジ日時 2023-08-26 17:52:53
合計ジャッジ時間 10,870 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,420 KB
testcase_01 AC 75 ms
71,244 KB
testcase_02 AC 75 ms
71,224 KB
testcase_03 AC 74 ms
71,480 KB
testcase_04 AC 74 ms
71,144 KB
testcase_05 AC 76 ms
71,056 KB
testcase_06 AC 76 ms
71,296 KB
testcase_07 AC 77 ms
71,228 KB
testcase_08 AC 75 ms
71,244 KB
testcase_09 AC 75 ms
70,924 KB
testcase_10 AC 75 ms
71,204 KB
testcase_11 AC 74 ms
71,428 KB
testcase_12 AC 76 ms
71,292 KB
testcase_13 AC 75 ms
71,408 KB
testcase_14 AC 83 ms
76,580 KB
testcase_15 AC 80 ms
76,376 KB
testcase_16 AC 76 ms
71,064 KB
testcase_17 AC 81 ms
76,628 KB
testcase_18 AC 75 ms
70,968 KB
testcase_19 AC 84 ms
76,376 KB
testcase_20 AC 81 ms
76,452 KB
testcase_21 AC 74 ms
71,432 KB
testcase_22 AC 82 ms
76,412 KB
testcase_23 AC 89 ms
77,132 KB
testcase_24 AC 100 ms
77,364 KB
testcase_25 AC 136 ms
80,500 KB
testcase_26 AC 84 ms
76,412 KB
testcase_27 AC 85 ms
76,532 KB
testcase_28 AC 134 ms
80,432 KB
testcase_29 AC 86 ms
76,184 KB
testcase_30 AC 88 ms
77,016 KB
testcase_31 AC 90 ms
77,012 KB
testcase_32 AC 85 ms
76,744 KB
testcase_33 AC 133 ms
80,608 KB
testcase_34 AC 133 ms
80,484 KB
testcase_35 AC 132 ms
80,528 KB
testcase_36 AC 132 ms
80,720 KB
testcase_37 AC 132 ms
80,500 KB
testcase_38 AC 130 ms
80,524 KB
testcase_39 AC 131 ms
80,792 KB
testcase_40 AC 131 ms
80,768 KB
testcase_41 AC 132 ms
80,732 KB
testcase_42 AC 132 ms
80,504 KB
testcase_43 AC 76 ms
71,088 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
B=[]
for _ in range(N):
    B.append(list(map(int,input().split())))

Score=[0]*(1<<N)

for S in range(1,1<<N):
    x=S&(-S)
    x_bit=x.bit_length()-1
    T=S^x

    C=Score[T]+A[x_bit]
    for i in range(N):
        if T&1:
            C+=B[x_bit][i]
        T>>=1

    Score[S]=C

Max=max(Score[1:])
Arg=Score.index(Max)

print(Max)
print(*[i+1 for i in range(N) if Arg&(1<<i)])
0