結果

問題 No.733 分身並列コーディング
ユーザー convexineqconvexineq
提出日時 2021-03-17 19:49:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 747 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 82,532 KB
実行使用メモリ 73,484 KB
最終ジャッジ日時 2024-04-27 12:14:51
合計ジャッジ時間 5,110 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,496 KB
testcase_01 AC 34 ms
52,584 KB
testcase_02 AC 34 ms
53,296 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 43 ms
60,240 KB
testcase_06 AC 34 ms
52,620 KB
testcase_07 WA -
testcase_08 AC 71 ms
65,004 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 38 ms
52,464 KB
testcase_13 AC 35 ms
52,260 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 34 ms
52,688 KB
testcase_17 AC 37 ms
58,972 KB
testcase_18 AC 53 ms
65,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 43 ms
61,068 KB
testcase_26 AC 37 ms
52,616 KB
testcase_27 AC 50 ms
64,156 KB
testcase_28 AC 70 ms
65,000 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 55 ms
64,428 KB
testcase_33 WA -
testcase_34 AC 54 ms
65,580 KB
testcase_35 AC 56 ms
65,612 KB
testcase_36 AC 59 ms
64,872 KB
testcase_37 AC 58 ms
64,372 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 55 ms
64,648 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def zeta_to_high(res,n):
    for i in range(n):
        i = 1<<i
        for j in range(1<<n):
            if j&i: res[j] += res[j^i]

def mobius_to_high(res,n):
    for i in range(n):
        i = 1<<i
        for j in range(1<<n):
            if j&i: res[j] -= res[j^i]

T,n,*a = map(int,open(0).read().split())
N = 1<<n
lst = [0]*N
for i in range(n):
    for j in range(1<<i):
        lst[j+(1<<i)] = lst[j] + a[i]
for i in range(N):
    lst[i] = int(lst[i] <= T)

if lst[-1]==1:
    print(1)
    exit()

MOD = 10**9+7
ans = 1
zeta_to_high(lst,n)
res = lst[:] 
while True:
    ans += 1
    for i in range(N):
        res[i] *= lst[i]
        res[i] %= MOD
    after = res[:]
    mobius_to_high(after,n)
    if after[-1]:
        break
print(ans)
0