Submission #1187039

#TimeUsernameProblemLanguageResultExecution timeMemory
1187039North1304Coins (IOI17_coins)C++20
Compilation error
0 ms0 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;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccYNkVRY.o: in function `main':
grader.cpp:(.text.startup+0x3e2): undefined reference to `coin_flips(std::vector<int, std::allocator<int> >, int)'
/usr/bin/ld: grader.cpp:(.text.startup+0xb8a): undefined reference to `find_coin(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status