結果

問題 No.462 6日知らずのコンピュータ
ユーザー lloyzlloyz
提出日時 2023-10-23 22:14:25
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 708 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 65,820 KB
最終ジャッジ日時 2023-10-23 22:14:35
合計ジャッジ時間 6,737 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n, k = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

mod = 10**9 + 7
Fact = [1]
for i in range(1, n + 1):
    Fact.append(Fact[-1] * i)
ans = 1
L = [0 for _ in range(n)]
for i in range(k):
    NL = [0 for _ in range(n)]
    a = A[i]
    cnt = 0
    for j in range(n):
        NL[j] = a % 2
        a //= 2
        if L[j] == 0 and NL[j] == 1:
            cnt += 1
        elif L[j] == 1 and NL[j] == 0:
            cnt = -1
            break
    if cnt == -1:
        print(0)
        exit()
    ans *= Fact[cnt]
    ans %= mod
    L = NL
NL = [1 for _ in range(n)]
cnt = 0
for i in range(n):
    if L[i] == 0 and NL[i] == 1:
        cnt += 1
ans *= Fact[cnt]
ans %= mod
print(ans)
0