Submission #1212057

#TimeUsernameProblemLanguageResultExecution timeMemory
1212057doublepunCoins (IOI17_coins)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#define endl "\n"
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* coin_flips(int* b, int c)
{
	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;
		}
	}
	return b;
}
int find_coin(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]));
}

Compilation message (stderr)

/usr/bin/ld: /tmp/cc780Rmz.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