Guest User

Untitled

a guest
Oct 21st, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. const rl = require('readline').createInterface({
  2. input: process.stdin
  3. })
  4. rl.question('', ans => {
  5. const a = parseInt(ans)
  6. rl.question('', ans => {
  7. ans = parseAns(ans)
  8. let y = ans.reduce((a, b) => a ^ b),
  9. x = 1;
  10. while(ans.includes(x ^ y) || ans.includes(x)) ++x
  11. console.log(`${x ^ y} ${x}`)
  12. })
  13. })
  14. function parseAns(ans) {
  15. return ans.split(' ').map(e => parseInt(e))
  16. }
Add Comment
Please, Sign In to add comment