# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
860962 | BlancaHM | Coins (IOI17_coins) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "coins.h"
using namespace std;
vector<int> coin_flips(vector<int> b, int c) {
vector<int> flips;
// Es obligatorio girar al menos una casilla => giremos una que no usemos
flips.append(63);
// Guardaremos c en binario en las primeras 7 casillas
for (int i = 0; i <= 6; i++) {
if ((b[i]<<i) != c & (1<<i)) {
flips.append(i);
}
}
return flips;
}
int find_coin(vector<int> b) {
// Convertimos la representacion binaria en decimal
int c = 0;
for (int i = 0; i <= 6; i++) {
c += (1<<b[i]);
}
return c;
}