# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1187039 | North1304 | Coins (IOI17_coins) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "coins.h"
using namespace std;
// Arnavaz's move: flip one coin so that the new XOR‐parity equals c
int coin_flips(const vector<int>& b, int c) {
int P = 0;
for (int i = 0; i < 64; i++) {
if (b[i]) P ^= i;
}
// flip position
return P ^ c;
}
// Shahrnaz's move: compute XOR of all tail‐positions to find c
int find_coin(const vector<int>& b) {
int P = 0;
for (int i = 0; i < 64; i++) {
if (b[i]) P ^= i;
}
return P;
}