結果

問題 No.1633 Sorting Integers (Multiple of 2^K)
ユーザー googol_S0googol_S0
提出日時 2021-07-30 21:08:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 649 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 76,528 KB
最終ジャッジ日時 2023-10-14 02:19:15
合計ジャッジ時間 7,082 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
75,592 KB
testcase_01 AC 76 ms
71,124 KB
testcase_02 AC 92 ms
76,528 KB
testcase_03 AC 78 ms
71,116 KB
testcase_04 AC 71 ms
70,920 KB
testcase_05 AC 74 ms
71,336 KB
testcase_06 AC 81 ms
71,464 KB
testcase_07 AC 78 ms
71,172 KB
testcase_08 WA -
testcase_09 AC 79 ms
70,980 KB
testcase_10 AC 73 ms
71,392 KB
testcase_11 AC 74 ms
70,916 KB
testcase_12 AC 76 ms
71,076 KB
testcase_13 AC 73 ms
71,412 KB
testcase_14 AC 74 ms
71,152 KB
testcase_15 AC 73 ms
71,076 KB
testcase_16 AC 75 ms
71,084 KB
testcase_17 AC 72 ms
71,020 KB
testcase_18 AC 78 ms
71,076 KB
testcase_19 AC 73 ms
71,292 KB
testcase_20 AC 75 ms
71,156 KB
testcase_21 AC 74 ms
70,956 KB
testcase_22 AC 75 ms
71,172 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
C=list(map(int,input().split()))
A=[]
for i in range(9):
  for j in range(C[i]):
    A.append(i+1)
ANS=0
M=(N+1)>>1
L=N>>1
for t in range(1,60):
  mod=1<<t
  P=[pow(10,i,mod) for i in range(N+1)]
  DP=[set() for i in range(1<<N)]
  DP[0]=set([0])
  for i in range(1<<N):
    c=bin(i).count('1')
    if c>=L:
      x=((1<<N)-1)^i
      for j in DP[i]:
        if (-j*P[N-c])%mod in DP[x]:
          ANS=t
          break
      if ANS==t:
        break
    if c>=M:
      continue
    for j in range(N):
      if (i>>j)&1:
        continue
      for k in DP[i]:
        DP[i|(1<<j)].add((k*10+A[j])%mod)
  if ANS<t:
    break
print(ANS)
0