結果

問題 No.462 6日知らずのコンピュータ
ユーザー Hoi_koroHoi_koro
提出日時 2016-12-13 00:38:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,676 bytes
コンパイル時間 1,146 ms
コンパイル使用メモリ 119,204 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-07 08:08:06
合計ジャッジ時間 3,422 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iterator>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <tuple>
#include <queue>
#include <stack>
#include <functional>
#include <utility>
#include <complex>
#include <bitset>
#include <numeric>
#include <random>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n) ;++(i))
#define REPN(i,a,n) FOR((i),(a),(a)+(n))
#define FOR(i,a,b) for(int (i)=(a); (i)<(b) ;++(i))
#define PB push_back
#define MP make_pair
#define SE second
#define FI first
#define DBG(a) cerr<<(a)<<endl;
#define dump(a) cerr<<#a <<' '<< a <<endl;
#define ALL(v) (v).begin(),(v).end()
typedef long long LL;  typedef pair<LL, LL> PLL; typedef vector<LL> VLL;
typedef pair<int,int>PI; typedef vector<int> VI;
const LL LINF=334ll<<53; const int INF=15<<26; const LL MOD=1E9+7;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,k;
    cin >> n >> k;
    vector<LL> a;
    LL ans=1ll;
    a.push_back(0ll);
    a.push_back((1ll<<n)-1ll);
    REP(i,k){
        LL tmp;
        cin >> tmp;
        a.push_back(tmp);
    }
    sort(ALL(a));
    a.erase(unique(ALL(a)),a.end());
    FOR(i,1,a.size()){
        LL cnt=__builtin_popcount(a[i])-__builtin_popcount(a[i-1]);
        REP(j,n){
            if(((a[i-1]>>j)&1)>((a[i]>>j)&1)){
                cout << 0 << endl;
                return 0;
            }
        }
        for(long long k=1;k<cnt+1;++k){
            ans=(ans*k)%MOD;
        }
    }
    cout << ans <<endl;
    return 0;
}
0