Submission #1235408

#TimeUsernameProblemLanguageResultExecution timeMemory
1235408candi_ositosCoins (IOI17_coins)C++20
0 / 100
5 ms584 KiB
#include "coins.h" #include <bits/stdc++.h> using namespace std; vector <int> coin_flips(vector <int> b, int a){ int xd=0; vector <bool> s(6), r(6), c(6); for(int i=0; i<6; ++i){ r[i]=a%2; a/=2; } int aux=1; for(int i=0; i<6; ++i){ s[i]=0; aux*=2; for(int j=0; j<64; ++j){ if(j%aux>aux/2-1){ s[i]=1-s[i]; } } } for(int i=0; i<6; ++i){ c[i]=s[i]; } for(int i=0; i<6; ++i){ if(r[i]){ c[i]=1-c[i]; } } aux=1; for(int i=0; i<6; ++i){ if(c[i]){ xd+=aux; } aux*=2; } vector <int> ret; ret.push_back(xd); return ret; } int find_coin(vector <int> b){ int xd=0; int aux=1; for(int i=0; i<6; ++i){ if(b[i]){ xd+=aux; } aux*=2; } return xd; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...