Language: C++

import std.stdio, std.conv, std.string;
import std.algorithm, std.array, std.container;
import std.numeric, std.math;
import core.bitop;
 
T RD(T = string)() { static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
 
long mod = pow(10, 9) + 7;
long moda(long x, long y) { return (x + y) % mod; }
long mods(long x, long y) { return ((x + mod) - (y % mod)) % mod; }
long modm(long x, long y) { return (x * y) % mod; }
 
void main()
{
	auto N = RD!ulong;
	auto K = RD!ulong;
	auto A = RDR.split.to!(ulong[]);
 
	ulong[64] bitCnt;
	foreach (e; A)
	{
		foreach (i; 0..64)
		{
			if (e & (cast(ulong)1 << i)) ++bitCnt[i];
		}
	}
 
	ulong x;
	ulong ans;
	foreach_reverse (i; 0..64)
	{
		if (bitCnt[i] > N / 2) continue;
 
		ulong bit = cast(ulong)1 << i;
		if (x + bit <= K) x += bit;
	}
 
	foreach (e; A)
	{
		ans += e ^ x;
	}
 
	writeln(ans);
	stdout.flush();
}

Compiler output:
a.cc:23:29: error: too many decimal points in number
   23 |                 foreach (i; 0..64)
      |                             ^~~~~
a.cc:31:29: error: too many decimal points in number
   31 |         foreach_reverse (i; 0..64)
      |                             ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio, std.conv, std.string;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import std.algorithm, std.array, std.container;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import std.numeric, std.math;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import core.bitop;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'T' does not name a type
    6 | T RD(T = string)() { static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res.to!T; }
      | ^
a.cc:7:1: error: 'string' does not name a type
    7 | string RDR()() { return readln.chomp; }
      | ^~~~~~
a.cc:9:12: error: 'pow' was not declared in this scope
    9 | long mod = pow(10, 9) + 7;
      |            ^~~
a.cc:14:1: error: '::main' must return 'int'
   14 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:16:18: error: 'RD' was not declared in this scope
   16 |         auto N = RD!ulong;
      |                  ^~
a.cc:17:20: error: expected ',' or ';' before '!' token
   17 |         auto K = RD!ulong;
      |                    ^
a.cc:18:18: error: 'RDR' was not declared in this scope
   18 |         auto A = RDR.split.to!(ulong[]);
      |                  ^~~
a.cc:20:9: error: 'ulong' was not declared in this scope; did you mean 'long'?
   20 |         ulong[64] bitCnt;
      |         ^~~~~
      |         long
a.cc:21:18: error: 'e' was not declared in this scope
   21 |         foreach (e; A)
      |                  ^
a.cc:21:22: error: expected ';' before ')' token
   21 |         foreach (e; A)
      |                      ^
      |                      ;
a.cc:29:14: error: expected ';' before 'x'
   29 |         ulong x;
      |              ^~
      |              ;
a.cc:30:14: error: expected ';' before 'ans'
   30 |         ulong ans;
      |              ^~~~
      |              ;
a.cc:31:26: error: 'i' was not declared in this scope
   31 |         foreach_reverse (i; 0..64)
      |                          ^
a.cc:39:19: error: expected ')' before ';' token
   39 |         foreach (e; A)
      |                 ~ ^
      |                   )
a.cc:39:22: error: expected ';' before ')' token
   39 |         foreach (e; A)
      |                      ^
      |                      ;
a.cc:44:17: error: 'ans' was not declared in this scope
   44 |         writeln(ans);
      |                 ^~~
a.cc:44:9: error: 'writeln' was not declared in this scope
   44 |         writeln(ans);
      |         ^~~~~~~
a.cc:45:9: error: 'stdout' was not declared in this scope
   45 |         stdout.flush();
      |         ^~~~~~
a.cc:1:1: note: 'stdout' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | import std.stdio, std.conv, std.string;