結果

問題 No.462 6日知らずのコンピュータ
ユーザー 0w10w1
提出日時 2016-12-13 01:57:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,493 bytes
コンパイル時間 1,923 ms
コンパイル使用メモリ 177,656 KB
実行使用メモリ 4,572 KB
最終ジャッジ日時 2023-08-20 01:17:50
合計ジャッジ時間 4,556 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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;
deque< ll > A;

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

void preprocess(){
  sort( A.begin(), A.end() );
  if( A.empty() or A[ 0 ] != 0 )
    A.emplace_front( 0 );
  if( A.back() != ( 1 << N ) - 1 )
    A.emplace_back( ( 1 << N ) - 1 );/*
  for( int i = 1; i < A.size(); ++i ){
    for( int j = 0; j < N; ++j )
      if( ( ~A[ i ] & 1LL << j ) and ( A[ i - 1 ] & 1LL << j ) )
        cout << 0 << endl, exit( 0 );
  }*/
  ll ans = 1LL;
  for( int i = 0; i + 1 < A.size(); ++i ){
    ll diff = A[ i ] ^ A[ i + 1 ];
    int c = 0;
    for( int j = 0; j < N; ++j )
      if( diff & 1LL << j )
        ++c;
    for( int j = 1; j <= c; ++j )
      ( ans *= j ) %= MOD7;
  }
  cout << ans << endl;
}

void solve(){

}

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