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 <bits/stdc++.h>
using namespace std;
vector<int> coin_flips(vector<int> b, int c){
vector<int> flips(64,0);
string binary = bitset<6>(c).to_string();
int currflip = 0;
for(int i = 0; i < 6; i++){
if(binary[i] != b[i]){
flips[currflip] = i;
currflip++;
}
}
for(int i = currflip; i < 64; i++) flips[i] = 63;
return flips;
}
int find_coin(vector<int> b){
int ans = 0;
for(int i = 0; i < 6; i++){
ans += pow(2,5-i) * int(b[i]);
}
return ans;
}
# | 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... |