結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー ああいいああいい
提出日時 2022-05-13 17:57:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 549 bytes
コンパイル時間 1,066 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 79,288 KB
最終ジャッジ日時 2023-09-29 01:31:12
合計ジャッジ時間 16,903 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,228 KB
testcase_01 AC 71 ms
71,436 KB
testcase_02 AC 71 ms
71,404 KB
testcase_03 AC 72 ms
71,372 KB
testcase_04 AC 71 ms
71,396 KB
testcase_05 AC 75 ms
71,380 KB
testcase_06 AC 70 ms
71,468 KB
testcase_07 AC 70 ms
71,420 KB
testcase_08 AC 70 ms
71,424 KB
testcase_09 AC 71 ms
71,384 KB
testcase_10 AC 70 ms
71,148 KB
testcase_11 AC 75 ms
71,320 KB
testcase_12 AC 71 ms
71,276 KB
testcase_13 AC 71 ms
71,572 KB
testcase_14 AC 82 ms
76,548 KB
testcase_15 AC 81 ms
76,384 KB
testcase_16 AC 80 ms
75,732 KB
testcase_17 AC 82 ms
76,744 KB
testcase_18 AC 71 ms
71,260 KB
testcase_19 AC 83 ms
76,688 KB
testcase_20 AC 81 ms
76,596 KB
testcase_21 AC 73 ms
71,432 KB
testcase_22 AC 85 ms
76,544 KB
testcase_23 AC 108 ms
77,332 KB
testcase_24 AC 133 ms
77,516 KB
testcase_25 AC 452 ms
79,288 KB
testcase_26 AC 88 ms
76,416 KB
testcase_27 AC 90 ms
76,600 KB
testcase_28 AC 446 ms
79,288 KB
testcase_29 AC 98 ms
76,552 KB
testcase_30 AC 111 ms
77,320 KB
testcase_31 AC 111 ms
77,240 KB
testcase_32 AC 91 ms
76,384 KB
testcase_33 AC 450 ms
79,220 KB
testcase_34 AC 444 ms
79,160 KB
testcase_35 AC 445 ms
79,140 KB
testcase_36 AC 445 ms
79,212 KB
testcase_37 AC 442 ms
79,180 KB
testcase_38 AC 448 ms
79,140 KB
testcase_39 AC 441 ms
78,968 KB
testcase_40 AC 446 ms
78,852 KB
testcase_41 AC 447 ms
79,140 KB
testcase_42 AC 444 ms
79,016 KB
testcase_43 AC 72 ms
71,532 KB
testcase_44 AC 449 ms
79,168 KB
testcase_45 AC 73 ms
71,124 KB
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 0
S = -1
dp = [0] * (1 << N)
for bit in range(1,1 << N):
    tmp = 0
    for i in range(N):
        if (bit >> i) & 1:
            tmp += A[i]
            for j in range(i + 1,N):
                if (bit >> j) & 1:
                    tmp += B[i][j]
    if tmp > ans:
        ans = tmp
        S = bit
    #print(bit,tmp)
print(ans)
l = []
for i in range(N):
    if (S >> i) & 1:
        l.append(i + 1)
print(*l)
                    
0