Submission #301217

#TimeUsernameProblemLanguageResultExecution timeMemory
301217phillipCoins (IOI17_coins)C++14
10 / 100
10 ms1908 KiB
#include "coins.h" #include <bits/stdc++.h> #define ll long long using namespace std; vector<int> coin_flips(vector<int> b, int c) { vector<int> flips; if(c==0) { if(b[0]==b[1])flips.push_back(9); else flips.push_back(0); } else { if(b[0]!=b[1])flips.push_back(9); else flips.push_back(0); } return flips; for(int i=0,j=1;i<8;j*=2,i++) { if(c&(1<<i)) { if(b[i]==0){flips.push_back(i);}//b[i]=1-b[i];} } else { if(b[i]==1){flips.push_back(i);}//b[i]=1-b[i];} } } if(flips.size()==0) { flips.push_back(0); flips.push_back(0); } // for(int i=0;i<flips.size();i++)cout<<flips[i]<<" "; return flips; } int find_coin(vector<int> b) { if(b[0]==b[1])return 0; return 1; int ret=0; for(int i=0,j=1;i<8;i++,j*=1) { if(b[i])ret+=(1<<i); } //cout<<ret<<" "; return ret; }
#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...