結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー zyxwzyxw
提出日時 2021-02-02 20:11:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 516 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 77,076 KB
最終ジャッジ日時 2023-09-12 11:21:29
合計ジャッジ時間 15,435 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,032 KB
testcase_01 AC 73 ms
71,264 KB
testcase_02 AC 73 ms
70,888 KB
testcase_03 AC 75 ms
71,096 KB
testcase_04 AC 73 ms
71,180 KB
testcase_05 AC 74 ms
71,236 KB
testcase_06 AC 74 ms
70,888 KB
testcase_07 AC 73 ms
71,332 KB
testcase_08 AC 73 ms
71,256 KB
testcase_09 AC 76 ms
71,200 KB
testcase_10 AC 77 ms
71,332 KB
testcase_11 AC 77 ms
71,288 KB
testcase_12 AC 76 ms
71,308 KB
testcase_13 AC 77 ms
71,232 KB
testcase_14 AC 88 ms
76,012 KB
testcase_15 AC 84 ms
76,516 KB
testcase_16 AC 77 ms
71,252 KB
testcase_17 AC 85 ms
76,572 KB
testcase_18 AC 75 ms
71,392 KB
testcase_19 AC 90 ms
76,544 KB
testcase_20 AC 86 ms
76,552 KB
testcase_21 AC 76 ms
71,356 KB
testcase_22 AC 89 ms
76,380 KB
testcase_23 AC 106 ms
76,856 KB
testcase_24 AC 138 ms
76,748 KB
testcase_25 AC 294 ms
76,788 KB
testcase_26 AC 90 ms
76,616 KB
testcase_27 AC 89 ms
76,256 KB
testcase_28 AC 286 ms
76,900 KB
testcase_29 AC 99 ms
76,344 KB
testcase_30 AC 107 ms
76,936 KB
testcase_31 AC 107 ms
76,940 KB
testcase_32 AC 91 ms
76,424 KB
testcase_33 AC 286 ms
76,984 KB
testcase_34 AC 287 ms
76,808 KB
testcase_35 AC 290 ms
76,916 KB
testcase_36 AC 288 ms
76,812 KB
testcase_37 AC 287 ms
76,984 KB
testcase_38 AC 288 ms
76,912 KB
testcase_39 AC 288 ms
77,032 KB
testcase_40 AC 287 ms
76,920 KB
testcase_41 AC 286 ms
76,892 KB
testcase_42 AC 288 ms
77,020 KB
testcase_43 AC 74 ms
71,104 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=0
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=ans_li_pre
print(ans)
print(*sorted(ans_li))
0