結果
| 問題 |
No.462 6日知らずのコンピュータ
|
| コンテスト | |
| ユーザー |
betit0919
|
| 提出日時 | 2019-07-07 20:38:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 969 bytes |
| コンパイル時間 | 914 ms |
| コンパイル使用メモリ | 109,772 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-05 09:21:42 |
| 合計ジャッジ時間 | 2,986 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 56 WA * 28 |
ソースコード
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <numeric>
#include <random>
#include <queue>
#include <deque>
#include <tuple>
#include <iomanip>
using namespace std;
typedef long long ll;
const int INF = (1 << 30) - 1;
const ll INFLL= (1LL << 61) - 1;
const int MOD = 1000000007;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
int N,k;
long long fac[100];
fac[0]=fac[1]=1;
for (int i=2;i<100;i++){
fac[i]=fac[i-1]*i%MOD;
}
cin>>N>>k;
vector<ll>a(k);
for(int i=0;i<k;i++)cin>>a[i];
a.push_back(0);a.push_back((1<<N)-1);
sort(ALL(a));
a.erase(unique(ALL(a)),a.end());
ll ans=1ll;
for(int i=0;i<a.size()-1;i++){
if((a[i+1]&a[i])==a[i]){
ans*=fac[__builtin_popcount(a[i+1]-a[i])];
ans%=MOD;
}else{
ans*=0;
}
}
cout<<ans<<endl;
}
betit0919