# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
580822 | HeyYouNotYouYou | Coins (IOI17_coins) | C++14 | 0 ms | 0 KiB |
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 "grader.cpp"
#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]==0&&b[1]==1) flips.push_back(1); //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]==0) flips.push_back(1); //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;
}