結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー googol_S0googol_S0
提出日時 2021-01-22 21:25:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 477 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 77,392 KB
最終ジャッジ日時 2023-08-27 17:15:00
合計ジャッジ時間 13,992 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,288 KB
testcase_01 AC 65 ms
71,372 KB
testcase_02 AC 66 ms
71,428 KB
testcase_03 AC 67 ms
71,124 KB
testcase_04 AC 63 ms
71,260 KB
testcase_05 AC 65 ms
71,308 KB
testcase_06 AC 62 ms
71,324 KB
testcase_07 AC 67 ms
71,316 KB
testcase_08 AC 65 ms
71,372 KB
testcase_09 AC 64 ms
71,460 KB
testcase_10 AC 63 ms
71,148 KB
testcase_11 AC 66 ms
71,160 KB
testcase_12 AC 64 ms
71,332 KB
testcase_13 AC 68 ms
71,596 KB
testcase_14 AC 76 ms
76,672 KB
testcase_15 AC 75 ms
76,572 KB
testcase_16 AC 71 ms
75,960 KB
testcase_17 AC 75 ms
76,604 KB
testcase_18 AC 66 ms
71,380 KB
testcase_19 AC 78 ms
76,552 KB
testcase_20 AC 74 ms
76,352 KB
testcase_21 AC 65 ms
71,444 KB
testcase_22 AC 74 ms
76,728 KB
testcase_23 AC 97 ms
77,096 KB
testcase_24 AC 116 ms
76,996 KB
testcase_25 AC 436 ms
77,260 KB
testcase_26 AC 80 ms
76,644 KB
testcase_27 AC 84 ms
76,608 KB
testcase_28 AC 432 ms
77,016 KB
testcase_29 AC 97 ms
76,648 KB
testcase_30 AC 99 ms
77,020 KB
testcase_31 AC 99 ms
77,144 KB
testcase_32 AC 84 ms
76,584 KB
testcase_33 AC 430 ms
77,072 KB
testcase_34 AC 439 ms
77,392 KB
testcase_35 AC 431 ms
77,384 KB
testcase_36 AC 437 ms
76,920 KB
testcase_37 AC 477 ms
76,916 KB
testcase_38 AC 424 ms
77,220 KB
testcase_39 AC 416 ms
77,200 KB
testcase_40 AC 425 ms
77,024 KB
testcase_41 AC 417 ms
77,204 KB
testcase_42 AC 414 ms
77,296 KB
testcase_43 AC 63 ms
71,484 KB
testcase_44 AC 425 ms
77,108 KB
testcase_45 AC 64 ms
71,316 KB
testcase_46 AC 426 ms
76,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
B=[list(map(int,input().split())) for i in range(N)]
P=A[0]
X=[1]
for i in range(1<<N):
  Q=0
  for j in range(N):
    if i&(1<<j):
      Q+=A[j]
      for k in range(j+1,N):
        if i&(1<<k):
          Q+=B[j][k]
  if P<Q:
    X=[]
    for j in range(N):
      if i&(1<<j):
        X.append(j+1)
    P=Q
print(P)
print(*X,sep=' ')
0