結果

問題 No.462 6日知らずのコンピュータ
ユーザー rlangevinrlangevin
提出日時 2023-03-02 08:58:46
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 499 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 81,740 KB
実行使用メモリ 65,880 KB
最終ジャッジ日時 2023-10-17 07:12:08
合計ジャッジ時間 6,119 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,468 KB
testcase_01 AC 36 ms
53,468 KB
testcase_02 AC 38 ms
56,940 KB
testcase_03 AC 39 ms
56,940 KB
testcase_04 AC 37 ms
53,468 KB
testcase_05 AC 37 ms
53,468 KB
testcase_06 AC 37 ms
53,468 KB
testcase_07 AC 36 ms
53,468 KB
testcase_08 RE -
testcase_09 AC 36 ms
53,468 KB
testcase_10 AC 36 ms
53,468 KB
testcase_11 AC 36 ms
53,468 KB
testcase_12 AC 36 ms
53,468 KB
testcase_13 AC 36 ms
53,468 KB
testcase_14 AC 37 ms
53,468 KB
testcase_15 AC 36 ms
53,468 KB
testcase_16 AC 37 ms
53,468 KB
testcase_17 AC 37 ms
53,468 KB
testcase_18 AC 37 ms
53,468 KB
testcase_19 AC 36 ms
53,468 KB
testcase_20 AC 36 ms
53,468 KB
testcase_21 AC 36 ms
53,468 KB
testcase_22 AC 36 ms
53,468 KB
testcase_23 AC 37 ms
53,468 KB
testcase_24 AC 36 ms
53,468 KB
testcase_25 AC 39 ms
56,940 KB
testcase_26 AC 36 ms
53,468 KB
testcase_27 AC 36 ms
53,468 KB
testcase_28 AC 36 ms
53,468 KB
testcase_29 AC 37 ms
53,468 KB
testcase_30 AC 36 ms
53,468 KB
testcase_31 AC 37 ms
53,468 KB
testcase_32 AC 37 ms
53,468 KB
testcase_33 AC 37 ms
53,468 KB
testcase_34 AC 37 ms
53,468 KB
testcase_35 AC 36 ms
53,468 KB
testcase_36 AC 37 ms
53,468 KB
testcase_37 AC 36 ms
53,468 KB
testcase_38 AC 37 ms
53,468 KB
testcase_39 AC 36 ms
53,468 KB
testcase_40 AC 36 ms
53,468 KB
testcase_41 AC 37 ms
53,468 KB
testcase_42 AC 37 ms
53,468 KB
testcase_43 AC 36 ms
53,468 KB
testcase_44 AC 37 ms
53,468 KB
testcase_45 AC 37 ms
53,468 KB
testcase_46 AC 37 ms
53,468 KB
testcase_47 AC 37 ms
53,468 KB
testcase_48 AC 37 ms
53,468 KB
testcase_49 AC 36 ms
53,468 KB
testcase_50 AC 36 ms
53,468 KB
testcase_51 AC 37 ms
53,468 KB
testcase_52 AC 37 ms
53,468 KB
testcase_53 AC 37 ms
53,468 KB
testcase_54 AC 37 ms
53,468 KB
testcase_55 AC 37 ms
53,468 KB
testcase_56 AC 38 ms
53,468 KB
testcase_57 AC 36 ms
53,468 KB
testcase_58 AC 36 ms
53,468 KB
testcase_59 AC 36 ms
53,468 KB
testcase_60 AC 37 ms
53,468 KB
testcase_61 AC 36 ms
53,468 KB
testcase_62 AC 36 ms
53,468 KB
testcase_63 AC 37 ms
53,468 KB
testcase_64 AC 36 ms
53,468 KB
testcase_65 AC 37 ms
53,468 KB
testcase_66 AC 37 ms
53,468 KB
testcase_67 AC 36 ms
53,468 KB
testcase_68 AC 37 ms
53,468 KB
testcase_69 AC 38 ms
53,468 KB
testcase_70 AC 36 ms
53,468 KB
testcase_71 AC 36 ms
53,468 KB
testcase_72 AC 37 ms
53,468 KB
testcase_73 AC 41 ms
53,468 KB
testcase_74 AC 37 ms
53,468 KB
testcase_75 AC 37 ms
53,468 KB
testcase_76 AC 37 ms
53,468 KB
testcase_77 AC 36 ms
53,468 KB
testcase_78 AC 37 ms
53,468 KB
testcase_79 RE -
testcase_80 RE -
testcase_81 RE -
testcase_82 RE -
testcase_83 RE -
testcase_84 AC 37 ms
53,468 KB
testcase_85 AC 36 ms
53,468 KB
testcase_86 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

def popcount(n):
    cnt = 0
    while n:
        cnt += n & 1
        n >>= 1
    return cnt

N, K = map(int, input().split())
if K:
    A = list(map(int, input().split()))
mod = 10 ** 9 + 7
A.append((1 << N) - 1)
A.append(0)
A.sort()

M = 65
fact = [1] * M
for i in range(1, M):
    fact[i] = fact[i - 1] * i
    fact[i] %= mod

ans = 1
for i in range(K + 1):
    if A[i] | A[i + 1] != A[i + 1]:
        print(0)
        exit()
    ans *= fact[popcount(A[i] ^ A[i + 1])]
    ans %= mod

print(ans)
0