Submission #116718

#TimeUsernameProblemLanguageResultExecution timeMemory
116718faustaadpCoins (IOI17_coins)C++17
10 / 100
13 ms1604 KiB
#include "coins.h" #include<bits/stdc++.h> typedef long long ll; #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; std::vector<int> coin_flips(std::vector<int> b, int c) { ll i,jum; std::vector<int> flips; for(i=0;i<64;i++) if(b[i]) jum++; if(c==0) { if(b[0]==0&&b[1]==0) flips.pb(2); else if(b[0]==1&&b[1]==1) flips.pb(2); else if(b[0]==1&&b[1]==0) flips.pb(0); else if(b[0]==0&&b[1]==1) flips.pb(0); return flips; } else if(c==1) { if(b[0]==0&&b[1]==1) flips.pb(2); else if(b[0]==1&&b[1]==0) flips.pb(2); else if(b[0]==0&&b[1]==0) flips.pb(0); else if(b[0]==1&&b[1]==1) flips.pb(0); return flips; } for(i=0;i<64;i++) if((b[i]==1&&i!=c)||(i==c&&b[i]==0)) flips.pb(i); //flips.clear(); if(flips.empty()) { flips.clear(); for(i=0;i<64;i++) flips.pb(i); } return flips; } int find_coin(std::vector<int> b) { ll i,sat=0; if(b[0]==b[1]) return 0; else return 1; for(i=0;i<64;i++) if(b[i]==1) sat++; if(sat==1) { for(i=0;i<64;i++) if(b[i]==1) return i; } else { for(i=0;i<64;i++) if(b[i]==0) return i; } }
#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...