結果

問題 No.462 6日知らずのコンピュータ
ユーザー Akijin_007Akijin_007
提出日時 2023-09-01 13:20:36
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 605 bytes
コンパイル時間 334 ms
コンパイル使用メモリ 87,240 KB
実行使用メモリ 79,168 KB
最終ジャッジ日時 2023-09-01 13:20:49
合計ジャッジ時間 12,597 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,312 KB
testcase_01 AC 71 ms
71,436 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 69 ms
71,440 KB
testcase_07 AC 70 ms
71,376 KB
testcase_08 AC 71 ms
71,228 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 69 ms
71,300 KB
testcase_12 AC 68 ms
71,520 KB
testcase_13 RE -
testcase_14 AC 70 ms
71,236 KB
testcase_15 AC 69 ms
71,224 KB
testcase_16 AC 71 ms
71,228 KB
testcase_17 AC 70 ms
71,104 KB
testcase_18 RE -
testcase_19 AC 71 ms
71,232 KB
testcase_20 AC 69 ms
71,444 KB
testcase_21 AC 70 ms
71,440 KB
testcase_22 AC 68 ms
71,512 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 70 ms
71,240 KB
testcase_27 AC 71 ms
71,000 KB
testcase_28 RE -
testcase_29 AC 70 ms
71,400 KB
testcase_30 AC 70 ms
71,252 KB
testcase_31 RE -
testcase_32 AC 69 ms
71,240 KB
testcase_33 RE -
testcase_34 AC 70 ms
71,432 KB
testcase_35 AC 70 ms
71,472 KB
testcase_36 RE -
testcase_37 AC 70 ms
71,220 KB
testcase_38 RE -
testcase_39 AC 71 ms
71,228 KB
testcase_40 RE -
testcase_41 RE -
testcase_42 AC 73 ms
71,340 KB
testcase_43 AC 71 ms
71,156 KB
testcase_44 RE -
testcase_45 RE -
testcase_46 AC 70 ms
71,312 KB
testcase_47 RE -
testcase_48 RE -
testcase_49 AC 70 ms
71,440 KB
testcase_50 AC 68 ms
71,156 KB
testcase_51 AC 71 ms
71,348 KB
testcase_52 AC 70 ms
71,348 KB
testcase_53 AC 71 ms
71,544 KB
testcase_54 AC 71 ms
71,132 KB
testcase_55 AC 71 ms
71,020 KB
testcase_56 AC 70 ms
71,160 KB
testcase_57 AC 72 ms
71,260 KB
testcase_58 AC 72 ms
71,220 KB
testcase_59 AC 73 ms
71,220 KB
testcase_60 AC 70 ms
71,236 KB
testcase_61 AC 71 ms
71,516 KB
testcase_62 AC 71 ms
71,548 KB
testcase_63 AC 72 ms
71,424 KB
testcase_64 AC 73 ms
71,384 KB
testcase_65 AC 72 ms
71,228 KB
testcase_66 AC 73 ms
71,448 KB
testcase_67 AC 71 ms
71,152 KB
testcase_68 AC 71 ms
71,024 KB
testcase_69 AC 73 ms
71,156 KB
testcase_70 AC 72 ms
71,100 KB
testcase_71 AC 70 ms
71,316 KB
testcase_72 AC 72 ms
71,080 KB
testcase_73 AC 69 ms
71,216 KB
testcase_74 AC 70 ms
71,344 KB
testcase_75 AC 68 ms
71,220 KB
testcase_76 AC 71 ms
71,556 KB
testcase_77 AC 69 ms
71,160 KB
testcase_78 AC 68 ms
71,448 KB
testcase_79 AC 69 ms
71,476 KB
testcase_80 AC 72 ms
71,380 KB
testcase_81 AC 70 ms
71,236 KB
testcase_82 AC 69 ms
71,412 KB
testcase_83 AC 69 ms
71,616 KB
testcase_84 AC 71 ms
71,372 KB
testcase_85 AC 73 ms
71,340 KB
testcase_86 AC 70 ms
71,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, k = map(int, input().split())
a = []
if k != 0:
    a = list(map(int, input().split()))
mod = 10 ** 9 + 7

m = 100
fac = [1] * (m + 1)
for i in range(1, m+1):
    fac[i] = (fac[i-1] * i) % mod

a = sorted(a)
if 0 not in a:
    a = [0] + a
if 2**N - 1 not in a:
    a.append(2**N-1)

f = 1
for i in range(k+1):
    u = a[i] ^ a[i+1]
    if u + a[i] != a[i+1]:
        f = 0
        break

if f == 0:
    print(0)
    exit()

def popcount(a):
    b = format(a, "b")
    return b.count("1")

ans = 1
for i in range(k+1):
    d = popcount(a[i+1]) - popcount(a[i])
    ans = (ans * fac[d]) % mod

print(ans)
0