Tester: multiple, see announcement
Print YES if certain values of (x,y) matches a given set of tuples otherwise print NO.
Buggy code plain text
You need to get (x,y)=(2,11) to get a wrong output. You can manipulate r via some quick bit operations to get r=25.
Note that there is a stray
YEZ the output. That is the bug in the code. So, we now know that we need to trigger
x = 2 and
y = 11.
This implies that
(r ^ 3) & (r ^ 31) == 3 and
(r ^ 18) | (r ^ 16) == 4. Also, we know that
r is less than 32, so it will be of 5 bits.
We have two equations and we can satisfy them bit-by-bit. That is to say, for each bit of
r, check if it’s being 0 or 1 can satisfy both the equations. Building
r bitwise we’ll get
11001, which is 25.