結果
| 問題 |
No.462 6日知らずのコンピュータ
|
| コンテスト | |
| ユーザー |
shinchan
|
| 提出日時 | 2020-10-26 22:57:23 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 788 bytes |
| コンパイル時間 | 2,009 ms |
| コンパイル使用メモリ | 197,168 KB |
| 最終ジャッジ日時 | 2025-01-15 15:57:41 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 54 WA * 30 |
ソースコード
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;
int main() {
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
ll n, k, ans = 1;
cin >> n >> k;
vector<ll> a(k+1, 0LL);
ll fac[100];
fac[0] = 1;
for(ll i = 1; i < 100; i++){
fac[i] = (fac[i - 1] * i) % mod;
}
for(int i=1;i<=k;i++) cin >> a[i];
a.pb((1LL << n) - 1);
for(int i=0;i<=k;i++){
if((a[i] & a[i + 1]) == a[i]){
ans *= fac[int(__builtin_popcountll(a[i + 1] - a[i]))];
ans %= mod;
}else ans = 0;
}
cout << ans << endl;
return 0;
}
shinchan