Submission #860966

#TimeUsernameProblemLanguageResultExecution timeMemory
860966BlancaHMCoins (IOI17_coins)C++14
25 / 100
8 ms1860 KiB
#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.push_back(63); // Guardaremos c en binario en las primeras 6 casillas for (int i = 0; i <= 5; i++) { // Guardamos el valor del i-esimo digito binario de c int valorDigito = (c & (1<<i)) >> i; if (b[i] != valorDigito) { flips.push_back(i); } } return flips; } int find_coin(vector<int> b) { // Convertimos la representacion binaria en decimal int c = 0; for (int i = 0; i <= 5; i++) { c += b[i] * (1<<i); } return c; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...