当前位置:网站首页>Atcoder bit operation & Conclusion + formula derivation
Atcoder bit operation & Conclusion + formula derivation
2022-06-26 14:23:00 【Honestbutter-】
D- An operation & Conclusion + Formula derivation
Conclusion :
- x + y = 2 ( x x+y=2(~x~ x+y=2( x & y ) + ( x ~y~)+~(~x~ y )+ ( x ^ y ) ~y~)~ y )
- ( x (~x~ ( x & y ) ~y~)~ y ) & ( x ~(~x~ ( x ^ y ) = 0 ~y~)=0 y )=0
This question defines A N D AND AND namely &
x + y = s , x x+y=s,~x~ x+y=s, x & y = a ~y=a y=a
s = 2 a + ~s=2a+ s=2a+ ( x (~x ( x^ y ) ( 1 ) ~y~)(1) y )(1)
a a~ a & ( x ~(~x~ ( x ^ y ) = 0 ( 2 ) ~y~)=0 (2) y )=0(2)
from (1)(2) obtain : s ≥ 2 a , a s≥2a,~a~ s≥2a, a & ( s − 2 a ) = 0 (s-2a)=0 (s−2a)=0
#include<iostream>
using namespace std;
long long a,s,t;
int main()
{
cin>>t;
while(t--)
{
cin>>a>>s;
if((s>=2*a)&&(((s-2*a)&a)==0))
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
return 0;
}
边栏推荐
- In insect classes and objects
- 启动Redis报错:Could not create Server TCP listening socket *:6379: bind: Address already in use–解决办法
- Svn commit error after deleting files locally
- Server create virtual environment run code
- 通俗语言说BM3D
- Pychar remotely connects to the server to run code
- How to convert data in cell cell into data in matrix
- Niuke challenge 53:c. strange magic array
- MHA高可用配合及故障切换
- Comparison of disk partition modes (MBR and GPT)
猜你喜欢

Comparison of disk partition modes (MBR and GPT)

9項規定6個嚴禁!教育部、應急管理部聯合印發《校外培訓機構消防安全管理九項規定》

Setup instance of layout manager login interface

RISC-V 芯片架构新规范

程序员必备,一款让你提高工作效率N倍的神器uTools

Related knowledge of libsvm support vector machine

Win10 home vs pro vs enterprise vs enterprise LTSC

Pycharm远程连接服务器来跑代码

Sword finger offer 05.58 Ⅱ string

Sword finger offer 18.22.25.52 Double pointer (simple)
随机推荐
Leaflet loading ArcGIS for server map layers
Common evaluation indexes of classification model -- confusion matrix and ROC curve
datasets Dataset类(2)
Jianzhi offer 43.47.46.48 dynamic planning (medium)
Matlab programming related knowledge
近期比较重要消息
Experience sharing of mathematical modeling: comparison between China and USA / reference for topic selection / common skills
Research on balloon problem
vmware部分设置
Hard (magnetic) disk (II)
程序员必备,一款让你提高工作效率N倍的神器uTools
9項規定6個嚴禁!教育部、應急管理部聯合印發《校外培訓機構消防安全管理九項規定》
Difference between classification and regression
Matplotlib common operations
BP neural network for prediction
How to convert data in cell cell into data in matrix
[hcsd application development training camp] one line of code second cloud evaluation article - experience from the experiment process
A must for programmers, an artifact utools that can improve your work efficiency n times
Knowledge about the determination coefficient R2 and the relationship with the correlation coefficient
Sword finger offer 45.61 Sort (simple)