# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1187045 | North1304 | Coins (IOI17_coins) | C++20 | 0 ms | 0 KiB |
#include "coins.h"
using namespace std;
// Arnavaz's move: flip one coin so that the new XOR‐parity equals c
int coin_flips(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(vector<int> b) {
int P = 0;
for (int i = 0; i < 64; i++) {
if (b[i]) P ^= i;
}
return P;
}