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 <iostream>
#include <vector>
#include <string>
using namespace std;
vector<int> coin_flips(vector<int> b, int c) {
vector<int> flip;
if(b[0] == b[2]) {
if(b[1] == b[0]) flip.push_back(c);
else {
if(c != 1) {
if(c == 0) flip.push_back(2);
else flip.push_back(0);
}
}
}
else {
if(b[0] == b[1]) {
if(c != 2) {
if(c == 1) flip.push_back(0);
else flip.push_back(1);
}
}
else {
if(c != 0) {
if(c == 2) flip.push_back(1);
else flip.push_back(2);
}
}
}
if(flip.empty()) flip.push_back(63);
return flip;
}
int find_coin(vector<int> b) {
vector<int> a[2];
for(int i = 0; i < 3; i++) a[b[i]].push_back(i);
if(a[0].size() == 1) return a[0].back();
return a[1].back();
}
# | 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... |