#include "coins.h"
#include <vector>
#include <string>
using namespace std;
vector<int> coin_flips(std::vector<int> b, int c)
{
vector<int>flips(8, 55);
for (int j = 0; j < 8; j++)
{
int xd = 1<<j;
bool xdd = (c & j);
if(xdd xor b[xd])
flips[j] = xd;
}
return flips;
}
int find_coin(std::vector<int> b)
{
int resp;
for (int j = 0; j < 8; j++)
{
int xd = 1<<j;
if (b[j])
{
resp+=xd;
}
}
return resp;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |