結果

問題 No.462 6日知らずのコンピュータ
ユーザー h_nosonh_noson
提出日時 2017-01-26 02:25:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 7,984 KB
最終ジャッジ日時 2023-08-24 23:15:43
合計ジャッジ時間 4,972 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,800 KB
testcase_01 AC 15 ms
7,772 KB
testcase_02 AC 16 ms
7,780 KB
testcase_03 AC 15 ms
7,944 KB
testcase_04 AC 15 ms
7,800 KB
testcase_05 AC 15 ms
7,800 KB
testcase_06 AC 15 ms
7,756 KB
testcase_07 WA -
testcase_08 AC 15 ms
7,792 KB
testcase_09 AC 16 ms
7,756 KB
testcase_10 AC 15 ms
7,884 KB
testcase_11 AC 16 ms
7,740 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 16 ms
7,792 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 15 ms
7,884 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 15 ms
7,888 KB
testcase_24 AC 15 ms
7,744 KB
testcase_25 AC 15 ms
7,804 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 16 ms
7,764 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 15 ms
7,672 KB
testcase_34 WA -
testcase_35 AC 15 ms
7,744 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 15 ms
7,744 KB
testcase_39 WA -
testcase_40 AC 15 ms
7,780 KB
testcase_41 AC 15 ms
7,864 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 15 ms
7,828 KB
testcase_45 AC 16 ms
7,800 KB
testcase_46 WA -
testcase_47 AC 15 ms
7,776 KB
testcase_48 WA -
testcase_49 AC 15 ms
7,764 KB
testcase_50 AC 16 ms
7,780 KB
testcase_51 AC 16 ms
7,920 KB
testcase_52 AC 16 ms
7,804 KB
testcase_53 AC 16 ms
7,744 KB
testcase_54 AC 16 ms
7,748 KB
testcase_55 AC 16 ms
7,800 KB
testcase_56 AC 16 ms
7,748 KB
testcase_57 AC 16 ms
7,740 KB
testcase_58 AC 16 ms
7,744 KB
testcase_59 AC 16 ms
7,916 KB
testcase_60 AC 15 ms
7,796 KB
testcase_61 AC 16 ms
7,740 KB
testcase_62 AC 16 ms
7,828 KB
testcase_63 AC 16 ms
7,916 KB
testcase_64 AC 16 ms
7,796 KB
testcase_65 AC 16 ms
7,668 KB
testcase_66 AC 15 ms
7,804 KB
testcase_67 AC 16 ms
7,932 KB
testcase_68 AC 16 ms
7,772 KB
testcase_69 AC 16 ms
7,884 KB
testcase_70 AC 16 ms
7,900 KB
testcase_71 AC 16 ms
7,860 KB
testcase_72 AC 16 ms
7,804 KB
testcase_73 AC 16 ms
7,744 KB
testcase_74 AC 16 ms
7,800 KB
testcase_75 AC 16 ms
7,804 KB
testcase_76 AC 16 ms
7,748 KB
testcase_77 AC 16 ms
7,796 KB
testcase_78 AC 15 ms
7,788 KB
testcase_79 AC 16 ms
7,760 KB
testcase_80 AC 15 ms
7,744 KB
testcase_81 AC 15 ms
7,788 KB
testcase_82 AC 15 ms
7,832 KB
testcase_83 AC 16 ms
7,804 KB
testcase_84 AC 15 ms
7,800 KB
testcase_85 AC 15 ms
7,780 KB
testcase_86 AC 15 ms
7,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def popcount(x):
    ret = 0
    while (x):
        x = x ^ (-x & x)
        ret += 1
    return ret

MOD = 10**9+7
[n,k] = map(int,input().split(' '))
if k > 0:
    a = list(map(int,input().split(' ')))
else:
    a = []
fact = [1 for i in range(n+1)]
for i in range(1,n+1):
    fact[i] = fact[i-1] * i % MOD
a.extend([0,(1<<n)-1])
a.sort()
ans = 1
for i in range(len(a)-1):
    if (a[i]^a[i+1])|a[i+1] != a[i+1]:
        ans *= 0
    else:
        ans *= fact[popcount(a[i]^a[i+1])]
print(ans)
0