# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
385986 | victoriad | Coins (IOI17_coins) | C++14 | 14 ms | 1888 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"
using namespace std;
vector<int> coin_flips(vector<int> b, int c) {
vector<int>co;
if(b[0]==0){
if(b[1]==0){
if(b[2]==0){
if(c==0){
co.push_back(63);
}
else if(c==1){
co.push_back(1);
}
else{
co.push_back(0);
}
}
else{
if(c==0){
co.push_back(2);
}
else if(c==1){
co.push_back(0);
}
else{
co.push_back(1);
}
}
}
else{
if(b[2]==0){
if(c==0){
co.push_back(1);
}
else if(c==1){
co.push_back(63);
}
else{
co.push_back(2);
}
}
else{
if(c==0){
co.push_back(1);
}
else if(c==1){
co.push_back(2);
}
else{
co.push_back(63);
}
}
}
}
else{
if(b[1]==0){
if(b[2]==0){
if(c==0){
co.push_back(0);
}
else if(c==1){
co.push_back(2);
}
else{
co.push_back(63);
}
}
else{
if(c==0){
co.push_back(0);
}
else if(c==1){
co.push_back(63);
}
else{
co.push_back(2);
}
}
}
else{
if(b[2]==0){
if(c==0){
co.push_back(63);
}
else if(c==1){
co.push_back(0);
}
else{
co.push_back(1);
}
}
else{
if(c==0){
co.push_back(2);
}
else if(c==1){
co.push_back(1);
}
else{
co.push_back(0);
}
}
}
}
return co;
}
int find_coin(vector<int> b) {
int x=0;
if(b[0]==1)x+=100;
if(b[1]==1)x+=10;
if(b[2]==1)x+=1;
if(x==0||x==1||x==110){
return 0;
}
else if(x==10||x==101){
return 1;
}
else{
return 2;
}
}
# | 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... |