結果
問題 |
No.462 6日知らずのコンピュータ
|
ユーザー |
![]() |
提出日時 | 2023-09-14 01:47:20 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 489 bytes |
コンパイル時間 | 92 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-01 09:51:50 |
合計ジャッジ時間 | 5,186 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 RE * 1 |
other | AC * 78 RE * 6 |
ソースコード
N,k=map(int,input().split()) A=list(map(int,input().split())) mod=10**9+7 FACT=[1] for i in range(1,100): FACT.append(FACT[-1]*i%mod) A.sort() if A==[] or A[0]!=0: A=[0]+A k+=1 if A[-1]!=(1<<N)-1: A.append((1<<N)-1) k+=1 LIST=[] for i in range(1,k): if A[i]&A[i-1]==A[i-1]: b=A[i-1].bit_count() c=A[i].bit_count() LIST.append(c-b) else: print(0) exit() ANS=1 for l in LIST: ANS=ANS*FACT[l]%mod print(ANS)