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;
vector<int> coin_flips(std::vector<int> b, int c) {
vector<int> flips;
////////subtask 1 and 2
if(c<2){
//[0,0],[0,1],[1,0],[1,1]
if(c==0){
if(b[0]==0&&b[1]==0) flips.push_back(0); //10
if(b[0]==1&&b[1]==0) flips.push_back(0); //00
if(b[0]==1&&b[1]==1) flips.push_back(1); //10
}else if(c==1){
if(b[0]==0&&b[1]==0) flips.push_back(1); //01
if(b[0]==0&&b[1]==1) flips.push_back(0); //11
if(b[0]==1&&b[1]==1) flips.push_back(0); //01
}
}
return flips;
}
int find_coin(std::vector<int> b) {
if((b[0]==1&&b[1]==0)||(b[0]==0&&b[1]==0)) return 0;
if((b[0]==0&&b[1]==1)||(b[0]==1&&b[1]==1)) return 1;
}
Compilation message (stderr)
coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:26:1: warning: control reaches end of non-void function [-Wreturn-type]
26 | }
| ^
# | 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... |