Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace wiggle
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] input = Console.ReadLine().Split(' ');
- List<long> result = new List<long>();
- for (int i = 0; i < input.Length - 1; i += 2)
- {
- long num1 = long.Parse(input[i]);
- long num2 = long.Parse(input[i + 1]);
- for (int j = 0; j <= 62; j += 2)
- {
- long currentnum1bit = ((num1 >> j) & 1L);
- long currentnum2bit = (num2 >> j) & 1L;
- if (currentnum1bit == 0)
- {
- num2 = num2 & ~(1L<< j);
- }
- if (currentnum1bit == 1)
- {
- num2 = num2 | (1L << j);
- }
- if (currentnum2bit == 0)
- {
- num1 = num1 & ~(1L << j);
- }
- if (currentnum2bit == 1)
- {
- num1 = num1 | (1L << j);
- }
- }
- long finalfirstnum = ~(num1 | (1L << 63));
- long finalsecondnum = ~(num2 | (1L << 63));
- result.Add(finalfirstnum);
- result.Add(finalsecondnum);
- }
- foreach(var num in result)
- {
- Console.WriteLine((ulong)num + " " + Convert.ToString(num,2).PadLeft(63,'0'));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment