結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー gorugo30gorugo30
提出日時 2021-01-22 21:35:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 533 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 77,300 KB
最終ジャッジ日時 2023-08-27 17:47:00
合計ジャッジ時間 12,372 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,316 KB
testcase_01 AC 66 ms
71,284 KB
testcase_02 AC 64 ms
71,280 KB
testcase_03 AC 64 ms
71,492 KB
testcase_04 AC 68 ms
71,648 KB
testcase_05 AC 65 ms
71,568 KB
testcase_06 AC 68 ms
71,556 KB
testcase_07 AC 72 ms
71,648 KB
testcase_08 AC 69 ms
71,548 KB
testcase_09 AC 69 ms
71,564 KB
testcase_10 AC 70 ms
71,196 KB
testcase_11 AC 67 ms
71,276 KB
testcase_12 AC 69 ms
71,372 KB
testcase_13 AC 65 ms
71,544 KB
testcase_14 AC 76 ms
76,196 KB
testcase_15 AC 77 ms
76,380 KB
testcase_16 AC 66 ms
71,372 KB
testcase_17 AC 75 ms
76,508 KB
testcase_18 AC 67 ms
71,368 KB
testcase_19 AC 79 ms
76,660 KB
testcase_20 AC 77 ms
76,456 KB
testcase_21 AC 68 ms
71,512 KB
testcase_22 AC 80 ms
76,628 KB
testcase_23 AC 100 ms
77,204 KB
testcase_24 AC 119 ms
77,120 KB
testcase_25 AC 279 ms
77,108 KB
testcase_26 AC 84 ms
76,724 KB
testcase_27 AC 82 ms
76,352 KB
testcase_28 AC 286 ms
77,228 KB
testcase_29 AC 92 ms
76,644 KB
testcase_30 AC 97 ms
77,080 KB
testcase_31 AC 101 ms
76,980 KB
testcase_32 AC 83 ms
76,640 KB
testcase_33 AC 277 ms
77,064 KB
testcase_34 AC 283 ms
77,264 KB
testcase_35 AC 283 ms
77,228 KB
testcase_36 AC 290 ms
77,208 KB
testcase_37 AC 293 ms
77,300 KB
testcase_38 AC 289 ms
77,140 KB
testcase_39 AC 286 ms
77,156 KB
testcase_40 AC 284 ms
76,976 KB
testcase_41 AC 287 ms
77,196 KB
testcase_42 AC 291 ms
77,228 KB
testcase_43 AC 68 ms
71,572 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 = -100000000000000000000000000000000
bestids = []
for S in range(1 << N):
    ids = []
    for i in range(N):
        if S >> i & 1:
            ids.append(i)
    point = 0
    for i in range(len(ids)):
        point += A[ids[i]]
        for j in range(i + 1, len(ids)):
            point += B[ids[i]][ids[j]]
    if point > ans:
        ans = point
        bestids = ids
print(ans)
print(*map(lambda x: x + 1, bestids))
0