結果

問題 No.462 6日知らずのコンピュータ
ユーザー 0w10w1
提出日時 2017-01-05 20:48:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,163 bytes
コンパイル時間 1,560 ms
コンパイル使用メモリ 169,528 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-22 14:47:10
合計ジャッジ時間 5,795 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< ll > vl;
typedef vector< vl > vvl;
typedef pair< int, int > pii;
typedef vector< pii > vp;
typedef vector< double > vd;
typedef vector< vd > vvd;
typedef vector< string > vs;

template< class T1, class T2 >
int upmin( T1 &x, T2 v ){
  if( x > v ){
    x = v;
    return 1;
  }
  return 0;
}

template< class T1, class T2 >
int upmax( T1 &x, T2 v ){
  if( x < v ){
    x = v;
    return 1;
  }
  return 0;
}

const int INF = 0x3f3f3f3f;

const int MOD7 = ( int ) 1e9 + 7;

int N, K;
vi A;

void init(){
  cin >> N >> K;
  A = vi( K );
  for( int i = 0; i < K; ++i ){
    cin >> A[ i ];
  }
}

void preprocess(){
  sort( A.begin(), A.end() );
  for( int i = 1; i < K; ++i ){
    if( ~A[ i ] & A[ i - 1 ] ){
      cout << 0 << endl;
      exit( 0 );
    }
  }
  int f = N - __builtin_popcount( A.back() );
  int ans = 1;
  for( int i = 2; i <= f; ++i ){
    ans = 1LL * ans * i % MOD7;
  }
  cout << ans << endl;
}

void solve(){

}

signed main(){
  ios::sync_with_stdio( 0 );
  init();
  preprocess();
  solve();
  return 0;
}
0