Submission #17500658


Source Code Expand

Copy
#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define per1(i,n) for(int i=n;i>0;i--)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
using mint=modint1000000007;
mint dp[501][1<<17],x=2;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,k;
    cin>>n>>k;
    vec A(n),B,num(100001,0);
    set<ll> C;
    rep(i,n) cin>>A[i],num[A[i]]++,C.insert(A[i]);
    for(auto i=C.begin();i!=C.end();i++) B.push_back(*i);
    dp[0][0]=1;
    rep(i,B.size())rep(j,1<<17){
        dp[i+1][j]+=dp[i][j]*x.pow(num[B[i]]-1);
        dp[i+1][j]+=dp[i][j^B[i]]*x.pow(num[B[i]]-1);
    }
    cout<<dp[B.size()][k].val();
}

Submission Info

Submission Time
Task F - Limited Xor Subset
User daiwakun
Language C++ (GCC 9.2.1)
Score 500
Code Size 897 Byte
Status
Exec Time 439 ms
Memory 261252 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:5:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<long long int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
    5 | #define rep(i,n) for(int i=0;i<n;i++)
......
   26 |     rep(i,B.size())rep(j,1<<17){
      |         ~~~~~~~~~~             
./Main.cpp:26:5: note: in expansion of macro ‘rep’
   26 |     rep(i,B.size())rep(j,1<<17){
      |     ^~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
× 3
× 33
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_1.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_16.txt, subtask_1_17.txt, subtask_1_18.txt, subtask_1_19.txt, subtask_1_2.txt, subtask_1_20.txt, subtask_1_21.txt, subtask_1_22.txt, subtask_1_23.txt, subtask_1_24.txt, subtask_1_25.txt, subtask_1_26.txt, subtask_1_27.txt, subtask_1_28.txt, subtask_1_29.txt, subtask_1_3.txt, subtask_1_30.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt, subtask_1_8.txt, subtask_1_9.txt
Case Name Status Exec Time Memory
sample_01.txt 178 ms 260584 KB
sample_02.txt 167 ms 260432 KB
sample_03.txt 169 ms 260492 KB
subtask_1_1.txt 181 ms 260384 KB
subtask_1_10.txt 200 ms 260540 KB
subtask_1_11.txt 192 ms 260436 KB
subtask_1_12.txt 181 ms 260576 KB
subtask_1_13.txt 185 ms 260464 KB
subtask_1_14.txt 175 ms 260396 KB
subtask_1_15.txt 172 ms 260596 KB
subtask_1_16.txt 171 ms 260392 KB
subtask_1_17.txt 169 ms 260580 KB
subtask_1_18.txt 178 ms 261124 KB
subtask_1_19.txt 178 ms 260844 KB
subtask_1_2.txt 173 ms 260456 KB
subtask_1_20.txt 365 ms 260460 KB
subtask_1_21.txt 361 ms 260576 KB
subtask_1_22.txt 165 ms 260580 KB
subtask_1_23.txt 167 ms 260596 KB
subtask_1_24.txt 167 ms 260568 KB
subtask_1_25.txt 183 ms 261252 KB
subtask_1_26.txt 172 ms 260504 KB
subtask_1_27.txt 165 ms 260576 KB
subtask_1_28.txt 163 ms 260596 KB
subtask_1_29.txt 168 ms 260440 KB
subtask_1_3.txt 171 ms 260436 KB
subtask_1_30.txt 169 ms 260576 KB
subtask_1_4.txt 170 ms 260492 KB
subtask_1_5.txt 168 ms 260460 KB
subtask_1_6.txt 213 ms 260656 KB
subtask_1_7.txt 276 ms 260460 KB
subtask_1_8.txt 439 ms 260460 KB
subtask_1_9.txt 429 ms 260596 KB