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"
#include <bits/stdc++.h>
using namespace std;
// subtask 4
vector<int> coin_flips(vector<int> b, int c) {
vector<int> flips;
string s;
int cc = c;
while(cc){
s = (char)(cc%2+'0') + s;
cc /= 2;
}
while(int(s.size()) < 8){
s = '0' + s;
}
for(int i=0; i<8; ++i){
if(s[i] == '1' && !b[i]){
flips.push_back(i);
} else if(s[i] == '0' && b[i]){
flips.push_back(i);
}
}
if(int(flips.size()) == 0){
flips.push_back(63);
}
return flips;
}
int find_coin(vector<int> b) {
int ans = 0;
for(int i=7; i>=0; --i){
if(b[i]){
ans += 1<<(7-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... |