能力值:
( LV2,RANK:10 )
|
-
-
19 楼
是的,如果已知 a+b=c 以及a xor b =d (c,d 为已知),则可以计算出a,b的值。但是这个方程组的解的个数是不确定的,有可能有很多,有可能无解。当 c=0xBF,d=0x13f 时候,至少有80个满足条件的解。
a xor b=bf
a+b=13f
a=40, b=ff; a=41, b=fe; a=42, b=fd; a=43, b=fc; a=44, b=fb;
a=45, b=fa; a=46, b=f9; a=47, b=f8; a=48, b=f7; a=49, b=f6;
a=4a, b=f5; a=4b, b=f4; a=4c, b=f3; a=4d, b=f2; a=4e, b=f1;
a=4f, b=f0; a=50, b=ef; a=51, b=ee; a=52, b=ed; a=53, b=ec;
a=54, b=eb; a=55, b=ea; a=56, b=e9; a=57, b=e8; a=58, b=e7;
a=59, b=e6; a=5a, b=e5; a=5b, b=e4; a=5c, b=e3; a=5d, b=e2;
a=5e, b=e1; a=5f, b=e0; a=60, b=df; a=61, b=de; a=62, b=dd;
a=63, b=dc; a=64, b=db; a=65, b=da; a=66, b=d9; a=67, b=d8;
a=68, b=d7; a=69, b=d6; a=6a, b=d5; a=6b, b=d4; a=6c, b=d3;
a=6d, b=d2; a=6e, b=d1; a=6f, b=d0; a=70, b=cf; a=71, b=ce;
a=72, b=cd; a=73, b=cc; a=74, b=cb; a=75, b=ca; a=76, b=c9;
a=77, b=c8; a=78, b=c7; a=79, b=c6; a=7a, b=c5; a=7b, b=c4;
a=7c, b=c3; a=7d, b=c2; a=7e, b=c1; a=7f, b=c0; a=c0, b=7f;
a=c1, b=7e; a=c2, b=7d; a=c3, b=7c; a=c4, b=7b; a=c5, b=7a;
a=c6, b=79; a=c7, b=78; a=c8, b=77; a=c9, b=76; a=ca, b=75;
a=cb, b=74; a=cc, b=73; a=cd, b=72; a=ce, b=71; a=cf, b=70;
a=d0, b=6f; a=d1, b=6e; a=d2, b=6d; a=d3, b=6c; a=d4, b=6b;
a=d5, b=6a; a=d6, b=69; a=d7, b=68; a=d8, b=67; a=d9, b=66;
a=da, b=65; a=db, b=64; a=dc, b=63; a=dd, b=62; a=de, b=61;
a=df, b=60; a=e0, b=5f; a=e1, b=5e; a=e2, b=5d; a=e3, b=5c;
a=e4, b=5b; a=e5, b=5a; a=e6, b=59; a=e7, b=58; a=e8, b=57;
a=e9, b=56; a=ea, b=55; a=eb, b=54; a=ec, b=53; a=ed, b=52;
a=ee, b=51; a=ef, b=50; a=f0, b=4f; a=f1, b=4e; a=f2, b=4d;
a=f3, b=4c; a=f4, b=4b; a=f5, b=4a; a=f6, b=49; a=f7, b=48;
a=f8, b=47; a=f9, b=46; a=fa, b=45; a=fb, b=44; a=fc, b=43;
a=fd, b=42; a=fe, b=41; a=ff, b=40; count=80
|