結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー zyxwzyxw
提出日時 2021-02-02 20:16:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 522 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 77,160 KB
最終ジャッジ日時 2023-09-12 11:22:12
合計ジャッジ時間 12,643 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,916 KB
testcase_01 AC 71 ms
70,948 KB
testcase_02 AC 76 ms
71,144 KB
testcase_03 AC 75 ms
71,172 KB
testcase_04 AC 73 ms
71,176 KB
testcase_05 AC 71 ms
70,996 KB
testcase_06 AC 74 ms
71,136 KB
testcase_07 AC 75 ms
71,080 KB
testcase_08 AC 72 ms
70,928 KB
testcase_09 AC 72 ms
71,184 KB
testcase_10 AC 74 ms
71,204 KB
testcase_11 AC 74 ms
71,176 KB
testcase_12 AC 73 ms
70,924 KB
testcase_13 AC 72 ms
71,092 KB
testcase_14 AC 80 ms
76,500 KB
testcase_15 AC 82 ms
76,252 KB
testcase_16 AC 76 ms
70,836 KB
testcase_17 AC 81 ms
76,376 KB
testcase_18 AC 74 ms
71,112 KB
testcase_19 AC 88 ms
76,200 KB
testcase_20 AC 81 ms
76,176 KB
testcase_21 AC 73 ms
71,148 KB
testcase_22 AC 86 ms
76,136 KB
testcase_23 AC 105 ms
76,708 KB
testcase_24 AC 130 ms
76,920 KB
testcase_25 AC 293 ms
76,856 KB
testcase_26 AC 88 ms
76,372 KB
testcase_27 AC 86 ms
76,236 KB
testcase_28 AC 283 ms
76,776 KB
testcase_29 AC 95 ms
76,432 KB
testcase_30 AC 102 ms
76,956 KB
testcase_31 AC 105 ms
76,560 KB
testcase_32 AC 89 ms
76,188 KB
testcase_33 AC 286 ms
76,980 KB
testcase_34 AC 284 ms
77,100 KB
testcase_35 AC 283 ms
76,992 KB
testcase_36 AC 282 ms
76,732 KB
testcase_37 AC 286 ms
76,628 KB
testcase_38 AC 287 ms
76,816 KB
testcase_39 AC 286 ms
76,728 KB
testcase_40 AC 285 ms
77,100 KB
testcase_41 AC 285 ms
77,160 KB
testcase_42 AC 285 ms
76,848 KB
testcase_43 AC 72 ms
71,260 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
B=[list(map(int,input().split())) for i in range(N)]
ans=-10**20
ans_li=[]
for i in range(2**N):
    ans_pre=0
    ans_li_pre=[]
    for j in range(N):
        if (i>>j)&1:
            ans_li_pre.append(j+1)
            ans_pre+=A[j]
    for j in range(len(ans_li_pre)-1):
        for k in range(j+1,len(ans_li_pre)):
            ans_pre+=B[ans_li_pre[j]-1][ans_li_pre[k]-1]
    if ans_pre>ans:
        ans=ans_pre
        ans_li=sorted(ans_li_pre)
print(ans)
print(*ans_li)
0