Submission #1212071

#TimeUsernameProblemLanguageResultExecution timeMemory
1212071doublepunCoins (IOI17_coins)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; string contoBin(int n) { string ans = ""; for (int r = 0;r < 6;r++) { stringstream ss; string pre; ss << (n%2); ss >> pre; ans+=pre; n = floor(n/2); } reverse(ans.begin(),ans.end()); return ans; } int find_coin(vector<int> b) { return ((b[0]*pow(2,5) + b[1]*pow(2,4) + b[2]*pow(2,3) + b[3]*pow(2,2) + b[4]*2 + b[5])); } vector<int> coin_flips(vector<int> &b, int c) { vector<int> fliped; string code = contoBin(c); for (int i = 0;i < 6;i++) { stringstream ss2; int temp; ss2 << code[i]; ss2 >> temp; if (b[i] != temp){ b[i] = temp; fliped.emplace_back(i); } } if (fliped.size() == 0) { fliped.emplace_back(63); } return fliped; }

Compilation message (stderr)

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