diff --git a/bin/Extreme Encoding/Problem b/bin/Extreme Encoding/Problem new file mode 100644 index 0000000..753b963 --- /dev/null +++ b/bin/Extreme Encoding/Problem @@ -0,0 +1,46 @@ +All submissions for this problem are available. +Lajuk is a little girl who loves playing with array. In her 10th birthday, she got two arrays as presents. Let’s call them A and B. +Both arrays have the same size n and contains integers between 0 to 30000. + +Lajuk’s hard-drive is almost full of presents and she barely has any space to keep the arrays. She discovered a brilliant +function to merge the array into one: + + +int encodeInteger(int x, int n){ + n = n<<(1<<(1<<(1<<1))); + x = x | n; + return x; +} +void encodeArray(int *A, int *B, int n){ + for(int i=0;i>16) + a.append(x-(b[i]<<16)) + print("Case "+str(j+1)+":") + print(*a) + print(*b)