Submission #1026753

#TimeUsernameProblemLanguageResultExecution timeMemory
1026753radaiosm7Coins (IOI17_coins)C++17
0 / 100
2 ms1128 KiB
#include "coins.h" #include <bits/stdc++.h> using namespace std; vector<int> coin_flips(vector<int> b, int c) { vector<int> flips; vector<int> digits; int base = 32; //while (base <= c) base *= 2; //base /= 2; while (base > 0) { if (c >= base) { digits.push_back(1); c -= base; } else digits.push_back(0); base /= 2; } reverse(digits.begin(), digits.end()); for (int i=0; i < 6; ++i) if (b[i] != digits[i]) flips.push_back(i); return flips; } int find_coin(vector<int> b) { int res = 0; int base = 1; for (int i=0; i < 6; ++i) { res += base*b[i]; base *= 2; } return res; }
#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...