結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー O2MTO2MT
提出日時 2021-01-23 17:26:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 567 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 77,724 KB
最終ジャッジ日時 2023-08-30 02:01:41
合計ジャッジ時間 15,214 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,212 KB
testcase_01 AC 71 ms
71,208 KB
testcase_02 AC 71 ms
70,956 KB
testcase_03 AC 70 ms
71,100 KB
testcase_04 AC 72 ms
71,268 KB
testcase_05 AC 72 ms
71,108 KB
testcase_06 AC 73 ms
71,232 KB
testcase_07 AC 74 ms
71,012 KB
testcase_08 AC 72 ms
71,076 KB
testcase_09 AC 71 ms
71,392 KB
testcase_10 AC 70 ms
71,096 KB
testcase_11 AC 73 ms
70,840 KB
testcase_12 AC 73 ms
71,132 KB
testcase_13 AC 73 ms
71,092 KB
testcase_14 AC 83 ms
76,088 KB
testcase_15 AC 81 ms
75,988 KB
testcase_16 AC 73 ms
71,104 KB
testcase_17 AC 83 ms
75,860 KB
testcase_18 AC 72 ms
71,192 KB
testcase_19 AC 96 ms
76,628 KB
testcase_20 AC 83 ms
76,084 KB
testcase_21 AC 72 ms
70,960 KB
testcase_22 AC 87 ms
76,564 KB
testcase_23 AC 125 ms
77,360 KB
testcase_24 AC 166 ms
77,388 KB
testcase_25 AC 428 ms
77,408 KB
testcase_26 AC 100 ms
76,720 KB
testcase_27 AC 94 ms
76,528 KB
testcase_28 AC 430 ms
77,232 KB
testcase_29 AC 114 ms
77,156 KB
testcase_30 AC 123 ms
77,568 KB
testcase_31 AC 122 ms
77,212 KB
testcase_32 AC 101 ms
77,048 KB
testcase_33 AC 426 ms
77,416 KB
testcase_34 AC 429 ms
77,136 KB
testcase_35 AC 428 ms
77,064 KB
testcase_36 AC 432 ms
77,356 KB
testcase_37 AC 427 ms
77,064 KB
testcase_38 AC 426 ms
77,724 KB
testcase_39 AC 427 ms
77,364 KB
testcase_40 AC 424 ms
77,544 KB
testcase_41 AC 426 ms
77,172 KB
testcase_42 AC 430 ms
77,268 KB
testcase_43 AC 70 ms
71,100 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 _ in range(N)]
ans_point = 0
ans_waon = [] 
for i in range(2**N):
    point = 0
    waon = []
    pattern = bin(i)[2:].zfill(N)
    for j in range(N):
        if pattern[j] == "1":
            point += A[j]
            waon.append(j+1)
    len_w = len(waon)
    for k in range(len_w):
        for l in range(k+1,len_w):
            point += B[waon[k]-1][waon[l]-1]
    if ans_point < point:
        ans_point = point
        ans_waon = waon

print(ans_point)
print(*ans_waon)
0