题目链接:https://ac.nowcoder.com/acm/contest/3003/I
题目大意:


#include<bits/stdc++.h>
#define LL long long
#define mid (l+r)/2
using namespace std;
const LL mod = 1e9+7;

int a[200005];
LL p[200005]={1};
int main(){

    int n;scanf("%d", &n);
    for(int i=1; i<=n; i++){
        scanf("%d", &a[i]);
        p[i]=p[i-1]*2;
    }
    sort(a+1, a+n+1);
    n=unique(a+1, a+n+1)-a-1;
    for(int i=0; i<30; i++){
        int s[2]={0};
        for(int k=1; k<=n; k++){
            if(a[k]&(1<<i)){
                s[1]++;
            }
            else{
                s[0]++;
            }
        }
        if(s[0]&&s[1]){
            printf("%lld\n", p[i]*(n-1));
            return 0;
        }
    }
    printf("0\n");

    return 0;
}