比赛过程:开局峰哥说I是签到,我签了。然后是H题,cqf签了。然后一个多小时后我们才过了F。再然后,就是罚坐到结束了。。。。。期间尝试开了K J G都无果而终,看了比赛数据这些题到结束都是只过了个位数
I. xay loves or
idea:
ACcode:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define LL long long
using namespace std;
LL x,s;
void solve()
{
scanf("%lld %lld",&x,&s);
if( ( x&s ) != x )
{
printf("0\n");
return ;
}
LL ans = 1;
bool pd = false;
if( x==s ) pd = true;
while( s )
{
if( x%2==1 )
{
ans *= 2;
}
x /= 2;
s /= 2;
}
if( pd ) ans--;
printf("%lld\n",ans);
return ;
}
int main()
{
solve();
return 0;
}
H. xay loves count
题意:给n个数字,在里面找数字使得
a
i
∗
a
j
=
a
k
a_i * a_j = a_k
ai∗aj=ak成立的数字,注意一个数字可以重复选择
idea: