Codeforces862C. Mahmoud and Ehab and the xor 【构造】
传送门不难发现只有n=2,x=0时才输出NO
特判n=1,2时
当n>=3:
令xorSum=1^2^3^….^(n-3)
t=x^xorSum
则可以构造出:
t!=0:1,2,3,....(n−3),t+(1<<18),(1<<18),0t!=0 : 1,2,3,....(n-3),t+(1<<18),(1<<18),0
t==0:1,2,3,...,(n−2),(1<<18),[
原创
2017-09-20 22:42:58 ·
357 阅读 ·
0 评论